# updateCollection

Mutation

Rename a Collection in the current workspace.

Available to agents as MCP tool `updateCollection` — see [Write tools](/api/v2/docs/mcp/write-tools#update-collection).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | `ID!` | Yes | — | UUID of the Collection to update (as returned by `createCollection` / `collections`). Collection management is available only in workspaces whose Collections use the standard storage; where they use an older format the ids `collections` returns are not accepted here and the call returns a userError without changing anything. |
| `input` | [`UpdateCollectionInput!`](/api/v2/docs/types/update-collection-input) | Yes | — | Mutation input. |

## Returns

| Name | Type | Description |
| --- | --- | --- |
| `collection` | [`Collection`](/api/v2/docs/types/collection) | The updated Collection. Null on validation failure or when not found. |
| `userErrors` | [`[UserError!]!`](/api/v2/docs/types/user-error) | List of user-facing validation errors. Empty on success. |

## Examples

### Rename a collection

Rename a Collection in the workspace.

```graphql
mutation UpdateCollectionDefault($id: ID!, $input: UpdateCollectionInput!) {
  updateCollection(id: $id, input: $input) {
    collection {
      id
      name
    }
    userErrors {
      field
      message
    }
  }
}
```

Variables:

```json
{
  "id": "122321ce-843e-5b07-9f56-94323c0ae39e",
  "input": {
    "name": "Best Sellers 2025"
  }
}
```

Response — HTTP 200:

```json
{
  "data": {
    "updateCollection": {
      "collection": {
        "id": "122321ce-843e-5b07-9f56-94323c0ae39e",
        "name": "Best Sellers 2025"
      },
      "userErrors": []
    }
  }
}
```
