> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# endstate.collections.list

> Returns a cursor-paginated list of collections. Use `external_id` to filter to one caller-supplied identifier.

```ts theme={null}
list(query?: ListParams & {
    external_id?: string;
}, options?: RequestOptions): Paginated<Collection, CollectionsListResponse>
```

|             |                                                                      |
| ----------- | -------------------------------------------------------------------- |
| Endpoint    | [`GET /v1/collections`](/api-reference/collections/list-collections) |
| Credential  | Secret key (`end_sk_...`)                                            |
| Retry class | `read`                                                               |

Retried on network failure, timeout, `429`, and `5xx`.

## Example

```ts theme={null}
const result = await endstate.collections.list();
```

## Parameters

<ParamField body="limit" type="integer">
  Maximum number of records to return. Defaults to 50; maximum 100.
</ParamField>

<ParamField body="cursor" type="string">
  Opaque cursor from the previous page.
</ParamField>

<ParamField body="external_id" type="string">
  Filter to collections with this external identifier.
</ParamField>

## Returns

`200` - `CollectionsListResponse`.

<ResponseField name="collections" type="object[]" required />

<ResponseField name="pagination" type="object" required />

## Errors

Branch on `error.code`, never on the HTTP status - several codes share one.

| Code                  | HTTP | Retry         |
| --------------------- | ---- | ------------- |
| `auth.unauthorized`   | 401  | Do not retry  |
| `internal.error`      | 500  | Safe to retry |
| `rate_limit.exceeded` | 429  | Safe to retry |
| `validation.failed`   | 400  | Do not retry  |

See [Errors and retries](/sdks/core/errors-and-retries) for the error types and how to narrow them.
