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

> Updates a collection's tap redirect URL. Send null to clear.

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

|             |                                                                                           |
| ----------- | ----------------------------------------------------------------------------------------- |
| Endpoint    | [`PATCH /v1/collections/{collection_id}`](/api-reference/collections/update-a-collection) |
| Credential  | Secret key (`end_sk_...`)                                                                 |
| Retry class | `write`                                                                                   |

Never repeated. The API accepts no idempotency key here, so a second send is a second write. Only `429 rate_limit.exceeded` is retried.

## Example

```ts theme={null}
const result = await endstate.collections.update(collection.id, {
  redirect_url: "https://brand.example/p",
});
```

## Parameters

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

<ParamField body="redirect_url" type="string | null" required>
  Tap redirect URL for this collection's units. Send null to clear.
</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.
