> ## 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.get

> Returns a single collection by id.

```ts theme={null}
get(collectionId: string, options?: RequestOptions): Promise<Collection>
```

|             |                                                                                        |
| ----------- | -------------------------------------------------------------------------------------- |
| Endpoint    | [`GET /v1/collections/{collection_id}`](/api-reference/collections/fetch-a-collection) |
| 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.get(collection.id);
```

## Parameters

<ParamField body="collection_id" type="string" required>
  Collection id.
</ParamField>

## Returns

`200` - `Collection`.

<ResponseField name="id" type="string" required />

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

<ResponseField name="name" type="string | null" required />

<ResponseField name="external_id" type="string | null" required />

<ResponseField name="redirect_url" type="string | null" required>
  URL a tap on this collection's units redirects to. Unit- and product-level redirects take precedence over this value.
</ResponseField>

## Errors

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

| Code                   | HTTP | Retry         |
| ---------------------- | ---- | ------------- |
| `auth.unauthorized`    | 401  | Do not retry  |
| `collection.not_found` | 404  | Do not retry  |
| `internal.error`       | 500  | 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.
