# removeItemFromCollections

Mutation

Remove an item from one or more collections.

Available to agents as MCP tool `removeItemFromCollections` — see [Write tools](/api/v2/docs/mcp/write-tools#remove-item-from-collections).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `collectionIds` | `[ID!]` | No | `[]` | IDs of collections to remove the item from, as returned by the `collections` query for this workspace. Several id forms are accepted depending on how the workspace stores Collections. An id from another workspace, or one this workspace cannot write through this API, rejects the WHOLE call with a userErrors entry naming the offending id under `collectionIds`. |
| `collectionNames` | `[String!]` | No | `[]` | Names of collections to remove the item from. |
| `itemId` | `ID!` | Yes | — | ID of the item to remove from collections. |

## Returns

| Name | Type | Description |
| --- | --- | --- |
| `item` | [`Item`](/api/v2/docs/types/item) | The updated item. |
| `userErrors` | [`[UserError!]!`](/api/v2/docs/types/user-error) | List of errors that occurred. |

## Examples

### Remove an item from collections

Remove an item from one or more collections.

```graphql
mutation RemoveItemFromCollectionsDefault($itemId: ID!, $collectionIds: [ID!]) {
  removeItemFromCollections(itemId: $itemId, collectionIds: $collectionIds) {
    item {
      id
      customAttributes
    }
    userErrors {
      field
      message
    }
  }
}
```

Variables:

```json
{
  "itemId": "63c311c4-32f0-5d8c-ac02-78b160f2290a",
  "collectionIds": [
    "122321ce-843e-5b07-9f56-94323c0ae39e"
  ]
}
```

Response — HTTP 200:

```json
{
  "data": {
    "removeItemFromCollections": {
      "item": {
        "id": "63c311c4-32f0-5d8c-ac02-78b160f2290a",
        "customAttributes": {
          "sentiment": "positive",
          "collections": []
        }
      },
      "userErrors": []
    }
  }
}
```
