## List Credentials

`client.Credentials.List(ctx, query) (*CursorPage[Credential], error)`

**get** `/v5/credentials`

Retrieve a paginated list of all credentials for the current account with optional name filtering.

### Parameters

- `query CredentialListParams`

  - `EndingBefore param.Field[string]`

  - `Limit param.Field[int64]`

  - `Name param.Field[string]`

    Filter credentials by name

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type Credential struct{…}`

  - `ID string`

  - `CreatedAt Time`

  - `CreatedByIdentityType string`

  - `CreatedByUserID string`

  - `CredentialMetadata map[string, any]`

  - `Description string`

  - `Name string`

  - `Type string`

  - `UpdatedAt Time`

  - `Object string`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.Credentials.List(context.TODO(), sgpdev.CredentialListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by_identity_type": "created_by_identity_type",
      "created_by_user_id": "created_by_user_id",
      "credential_metadata": {
        "foo": "bar"
      },
      "description": "description",
      "name": "name",
      "type": "type",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "object": "object"
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```
