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

# Set Item Xattrs

> Attach or update custom key-value metadata on a Library item

```
PUT /openapi/memorylake/api/v1/drives/items/{item_id}/xattrs
```

Stores your own string key-value pairs (extended attributes, or *xattrs*) on a Library file or folder. Use this to tag items with metadata your application cares about — for example a tenant ID, a workflow status, or a content classification — without changing the file itself.

The call **merges** with whatever xattrs the item already has: keys you send are added or overwritten; keys already on the item that you don't send are left alone. To remove a key, call [Delete Item Xattrs](/features/memorylake/api-reference/library/delete-item-xattrs).

<Note>
  The system reserves a few internal xattr keys it manages on its own. Sending values for those keys has no effect — they're silently filtered. The system root folders (`My Space`, `WPS Space`, `Lark Space`) refuse xattr writes entirely and return `403`.
</Note>

<Note>
  **Permission required:** [`drive:item_modify`](/features/team-collaboration/permission-reference#edit-your-files) · `service`
</Note>

### Path Parameters

<ParamField path="item_id" type="string" required>
  ID of the file or folder to set xattrs on.
</ParamField>

### Request Body

<ParamField body="x_attrs" type="object" required>
  Map of `string → string` to upsert onto the item. Each entry is one extended attribute. An empty map is allowed but a no-op.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT 'https://app.memorylake.ai/openapi/memorylake/api/v1/drives/items/sc-5c6bf0f82d624a20a6fa4696997bdd46:7d8cf1e93f634b31b5/xattrs' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "x_attrs": {
        "tenant_id": "acme-corp",
        "review_status": "approved"
      }
    }'
  ```
</RequestExample>

### Response

<ResponseField name="success" type="boolean">Indicates if the request was successful</ResponseField>
<ResponseField name="message" type="string">Human-readable status message</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Operation completed successfully"
  }
  ```
</ResponseExample>

<Tip>
  To read back the current xattrs on an item, call [Get Item](/features/memorylake/api-reference/library/get-item) — its response includes the full `x_attrs` map.
</Tip>
