SPB Git

Repository Public

chats.md 29.5 KB 1,119 lines markdown

1---2title: Chats3url: https://platform.claude.com/docs/en/api/compliance/apps/chats4---56# Chats78## List chats910**GET** `/v1/compliance/apps/chats`1112Lists chat metadata with filtering capabilities for targeted13compliance review. Results are sorted chronologically (time ascending)14by the `order_by` key, with ties broken by id.1516**Deprecation notice:** Combining `user_ids[]` with any `updated_at.*`17filter is deprecated and will be rejected with HTTP 400 after182026-09-22. For incremental polling by update time, omit `user_ids[]`19and set `order_by=updated_at` with `after_id` cursor pagination —20this returns the same chats across the whole organization in a single21request stream. For per-user listing, use `created_at.*` filters (or22no time filter) with the default `order_by`. `user_ids[]` with23`order_by=updated_at` is already rejected.2425### Query parameters2627- `after_id: optional string`2829  Pagination cursor for retrieving the next page of results. To paginate, pass the `last_id` value from the most recent response. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.3031- `before_id: optional string`3233  Pagination cursor for retrieving the previous page of results. To paginate, pass the `first_id` value from the most recent response. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.3435- `created_at: optional object`3637  - `gt: optional string`3839    Filter chats created after this time (RFC 3339 format)4041    format: date-time4243  - `gte: optional string`4445    Filter chats created at or after this time (RFC 3339 format)4647    format: date-time4849  - `lt: optional string`5051    Filter chats created before this time (RFC 3339 format)5253    format: date-time5455  - `lte: optional string`5657    Filter chats created at or before this time (RFC 3339 format)5859    format: date-time6061- `limit: optional number`6263  Maximum results (default: 100, max: 1000)6465  default: 100, maximum: 1000, minimum: 16667- `order_by: optional "created_at" or "updated_at"`6869  Sort key for results. `created_at` (default) sorts by chat creation time. `updated_at` sorts by last update time and is only supported for org-wide queries (omit user_ids[]). For org-wide queries, any time filter must match the sort key: `created_at.*` filters require `order_by=created_at`, and `updated_at.*` filters require `order_by=updated_at`.7071  default: created_at7273  - `"created_at"`7475  - `"updated_at"`7677- `organization_ids: optional array of string`7879  Filter by organization IDs (accepts `org_...` or organization UUID). Enumerate IDs via `GET /v1/compliance/organizations`.8081- `project_ids: optional array of string`8283  Filter by project IDs (accepts `claude_proj_...`). Enumerate IDs via `GET /v1/compliance/apps/projects`. Requires user_ids[]; not supported for org-wide queries.8485- `updated_at: optional object`8687  - `gt: optional string`8889    Filter chats updated after this time (RFC 3339 format). Combining updated_at filters with `user_ids[]` is deprecated and will be rejected after 2026-09-22; for updated_at-windowed polling, omit `user_ids[]` and use `order_by=updated_at` with `after_id` pagination.9091    format: date-time9293  - `gte: optional string`9495    Filter chats updated at or after this time (RFC 3339 format). Combining updated_at filters with `user_ids[]` is deprecated and will be rejected after 2026-09-22; for updated_at-windowed polling, omit `user_ids[]` and use `order_by=updated_at` with `after_id` pagination.9697    format: date-time9899  - `lt: optional string`100101    Filter chats updated before this time (RFC 3339 format). Combining updated_at filters with `user_ids[]` is deprecated and will be rejected after 2026-09-22; for updated_at-windowed polling, omit `user_ids[]` and use `order_by=updated_at` with `after_id` pagination.102103    format: date-time104105  - `lte: optional string`106107    Filter chats updated at or before this time (RFC 3339 format). Combining updated_at filters with `user_ids[]` is deprecated and will be rejected after 2026-09-22; for updated_at-windowed polling, omit `user_ids[]` and use `order_by=updated_at` with `after_id` pagination.108109    format: date-time110111- `user_ids: optional array of string`112113  Filter to chats created by specific users (max 10 per request). Omit for an org-wide query. Enumerate IDs via `GET /v1/compliance/organizations/{org_uuid}/users`. Deprecated combination: passing `user_ids[]` together with any `updated_at.*` filter is deprecated and will be rejected after 2026-09-22. For `updated_at`-windowed polling, omit `user_ids[]` and use `order_by=updated_at` with `after_id` pagination.114115  maxItems: 10116117### Headers118119- `"x-api-key": optional string`120121### Returns122123- `data: array of object`124125  List of chat metadata sorted chronologically by the request's `order_by` key (default `created_at`), tie break by id126127  - `id: string`128129    Chat ID130131  - `created_at: string`132133    Creation timestamp134135    format: date-time136137  - `deleted_at: string or null`138139    Deletion timestamp if deleted140141    format: date-time142143  - `href: string`144145    URL to view this chat in claude.ai146147  - `model: string or null`148149    Model selected for this chat (e.g. 'claude-opus-5'). May be null for legacy chats that never had a model recorded.150151  - `name: string`152153    Chat name/title154155  - `organization_uuid: string`156157    Organization UUID this chat belongs to158159  - `project_id: string or null`160161    Project ID this chat belongs to162163  - `updated_at: string`164165    Last update timestamp166167    format: date-time168169  - `user: object or null`170171    The user who created the chat.172173    Null when the API key is restricted to one organization and the creator174    is no longer a member of it (for example, after they were removed from175    it).176177    A key for the whole parent organization returns the creator's `id`178    and current `email_address` for every chat; on the list endpoint, pass179    `organization_ids[]` to keep the results to one organization. For the180    email address the creator had when the chat was created, query181    `GET /v1/compliance/activities` with `activity_types[]=claude_chat_created`182    and a `created_at` window around the chat's `created_at`, find the event183    whose `claude_chat_id` matches this chat's `id`, and read184    `actor.email_address`. These events exist only for chats created after185    compliance logging was enabled for the organization.186187    - `id: string`188189      User identifier190191    - `email_address: string`192193      User's email address194195  - `organization_id: string`196197    **Deprecated**198199    Organization ID this chat belongs to200201- `first_id: string or null`202203  Opaque pagination cursor for the first chat in the current result set. Pass as `before_id` on the next request to page backwards. Backward pagination is only supported for per-user queries (`user_ids[]` set); org-wide queries do not accept `before_id`. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.204205- `has_more: boolean`206207  Whether more records exist beyond the current result set208209- `last_id: string or null`210211  Opaque pagination cursor for the last chat in the current result set. Pass as `after_id` on the next request to page forwards. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.212213### Example214215```bash216curl https://api.anthropic.com/v1/compliance/apps/chats \217    -H 'anthropic-version: 2023-06-01' \218    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"219```220221#### Response (200)222223```json224{225  "data": [226    {227      "id": "claude_chat_abc123",228      "name": "Product Requirements Discussion",229      "created_at": "2025-06-07T08:09:10Z",230      "updated_at": "2025-06-07T09:10:11Z",231      "organization_id": "org_abc123",232      "organization_uuid": "abcdef01-2345-6789-abcd-ef0123456789",233      "project_id": "claude_proj_xyz789",234      "model": "claude-opus-5",235      "user": {236        "id": "user_xyz456",237        "email_address": "user@example.com"238      },239      "href": "https://claude.ai/chat/abcdef01-2345-6789-abcd-ef0123456789"240    }241  ],242  "has_more": false,243  "first_id": "eyJrIjogImNyZWF0ZWRfYXQiLCAidCI6ICIyMDI1LTA2LTA3VDA4OjA5OjEwKzAwOjAwIiwgImlkIjogImFiY2RlZjAxLTIzNDUtNjc4OS1hYmNkLWVmMDEyMzQ1Njc4OSJ9",244  "last_id": "eyJrIjogImNyZWF0ZWRfYXQiLCAidCI6ICIyMDI1LTA2LTA3VDA4OjA5OjEwKzAwOjAwIiwgImlkIjogImFiY2RlZjAxLTIzNDUtNjc4OS1hYmNkLWVmMDEyMzQ1Njc4OSJ9"245}246```247248## Delete chat249250**DELETE** `/v1/compliance/apps/chats/{claude_chat_id}`251252Permanently deletes a chat and all associated messages and253files. This is a destructive operation that cannot be undone.254255### Path parameters256257- `claude_chat_id: string`258259  The chat ID (tagged ID, e.g., claude_chat_abc123)260261### Headers262263- `"x-api-key": optional string`264265### Returns266267- `type: optional "claude_chat_deleted"`268269  Constant string confirming deletion270271  default: claude_chat_deleted272273- `id: string`274275  The ID of the Claude chat that was deleted276277### Example278279```bash280curl https://api.anthropic.com/v1/compliance/apps/chats/$CLAUDE_CHAT_ID \281    -X DELETE \282    -H 'anthropic-version: 2023-06-01' \283    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"284```285286#### Response (200)287288```json289{290  "id": "claude_chat_abc123",291  "type": "claude_chat_deleted"292}293```294295## Domain types296297### Chat List Response298299- `ChatListResponse object`300301  Chat metadata for listing chats (without messages).302303  - `id: string`304305    Chat ID306307  - `created_at: string`308309    Creation timestamp310311    format: date-time312313  - `deleted_at: string or null`314315    Deletion timestamp if deleted316317    format: date-time318319  - `href: string`320321    URL to view this chat in claude.ai322323  - `model: string or null`324325    Model selected for this chat (e.g. 'claude-opus-5'). May be null for legacy chats that never had a model recorded.326327  - `name: string`328329    Chat name/title330331  - `organization_uuid: string`332333    Organization UUID this chat belongs to334335  - `project_id: string or null`336337    Project ID this chat belongs to338339  - `updated_at: string`340341    Last update timestamp342343    format: date-time344345  - `user: object or null`346347    The user who created the chat.348349    Null when the API key is restricted to one organization and the creator350    is no longer a member of it (for example, after they were removed from351    it).352353    A key for the whole parent organization returns the creator's `id`354    and current `email_address` for every chat; on the list endpoint, pass355    `organization_ids[]` to keep the results to one organization. For the356    email address the creator had when the chat was created, query357    `GET /v1/compliance/activities` with `activity_types[]=claude_chat_created`358    and a `created_at` window around the chat's `created_at`, find the event359    whose `claude_chat_id` matches this chat's `id`, and read360    `actor.email_address`. These events exist only for chats created after361    compliance logging was enabled for the organization.362363    - `id: string`364365      User identifier366367    - `email_address: string`368369      User's email address370371  - `organization_id: string`372373    **Deprecated**374375    Organization ID this chat belongs to376377### Chat Delete Response378379- `ChatDeleteResponse object`380381  Response for deleting a Claude chat.382383  - `type: optional "claude_chat_deleted"`384385    Constant string confirming deletion386387    default: claude_chat_deleted388389  - `id: string`390391    The ID of the Claude chat that was deleted392393## Chats › Messages394395### Get chat messages396397**GET** `/v1/compliance/apps/chats/{claude_chat_id}/messages`398399Retrieves message history and file metadata for a specific chat.400401#### Path parameters402403- `claude_chat_id: string`404405  The chat ID (tagged ID, e.g., claude_chat_abc123)406407#### Query parameters408409- `after_id: optional string`410411  Pagination cursor for retrieving the next page of results. To paginate, pass the `last_id` value from the most recent response. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.412413- `before_id: optional string`414415  Pagination cursor for retrieving the previous page of results. To paginate, pass the `first_id` value from the most recent response. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.416417- `created_at: optional object`418419  - `gt: optional string`420421    Filter messages created after this time (RFC 3339 format)422423    format: date-time424425  - `gte: optional string`426427    Filter messages created at or after this time (RFC 3339 format)428429    format: date-time430431  - `lt: optional string`432433    Filter messages created before this time (RFC 3339 format)434435    format: date-time436437  - `lte: optional string`438439    Filter messages created at or before this time (RFC 3339 format)440441    format: date-time442443- `limit: optional number`444445  Maximum results (max: 1000). When omitted, the full result set is returned in one response.446447  maximum: 1000, minimum: 1448449- `order: optional "asc" or "desc"`450451  Sort direction for messages within the response. `asc` (the default) returns oldest-first; `desc` returns newest-first.452453  default: asc454455  - `"asc"`456457  - `"desc"`458459- `tool_result_max_chars: optional number`460461  Maximum characters returned per tool-result text item. Items longer than this are shortened and the block's `truncated` field is set. Pass -1 to disable the limit.462463  default: 10000, minimum: -1464465- `tool_use_input_max_chars: optional number`466467  Maximum characters of JSON-encoded tool input returned per tool_use block. Inputs longer than this are shortened and the block's `truncated` field is set. Pass -1 to disable the limit.468469  default: 10000, minimum: -1470471- `updated_at: optional object`472473  - `gt: optional string`474475    Filter messages updated after this time (RFC 3339 format)476477    format: date-time478479  - `gte: optional string`480481    Filter messages updated at or after this time (RFC 3339 format)482483    format: date-time484485  - `lt: optional string`486487    Filter messages updated before this time (RFC 3339 format)488489    format: date-time490491  - `lte: optional string`492493    Filter messages updated at or before this time (RFC 3339 format)494495    format: date-time496497#### Headers498499- `"x-api-key": optional string`500501#### Returns502503- `id: string`504505  Chat ID506507- `chat_messages: array of object`508509  Array of chat messages in order of created_at510511  - `id: string`512513    Unique identifier for the message e.g. 'claude_chat_msg_abcd1234'514515  - `artifacts: array of object or null`516517    Versioned documents generated or updated by the assistant in this message. Download via `GET /v1/compliance/apps/artifacts/{artifact_version_id}/content`.518519    - `id: string`520521      Artifact ID e.g. 'claude_artifact_abc123'522523    - `artifact_type: string or null`524525      MIME-like artifact type e.g. 'application/vnd.ant.code'526527    - `title: string or null`528529      Artifact title530531    - `version_id: string`532533      Artifact version ID e.g. 'claude_artifact_version_abc123'534535  - `content: array of Text or ToolUse or ToolResult`536537    Content blocks within the message538539    - `Text object`540541      Text content block.542543      - `type: "text"`544545        default: text546547      - `text: string`548549        Text content from human or assistant550551      - `thinking_redacted: boolean`552553        True when content enclosed in the assistant's internal-reasoning tags (or the tag markup itself) was removed from `text` during export. Removal never occurs with this field false. Always false on human messages, whose text is exported verbatim.554555        default: false556557      - `truncated: boolean`558559        True when `text` was shortened by the server's fixed per-string bound (1 MiB). Always false on chat text blocks.560561        default: false562563    - `ToolUse object`564565      Tool invocation requested by the assistant.566567      - `type: "tool_use"`568569        default: tool_use570571      - `id: string or null`572573        Tool-use ID, e.g. 'toolu_01AbC...'574575      - `input: string`576577        Arguments passed to the tool, as a JSON-encoded string. May be shortened — see the `truncated` field578579      - `integration_name: string or null`580581        Name of the integration that provides this tool, when applicable582583      - `mcp_server_url: string or null`584585        Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable586587      - `name: string`588589        Name of the tool invoked590591      - `truncated: boolean`592593        True when `input` was shortened. Pass the endpoint's tool-use input max parameter as -1 to request full content, subject to any server-side maximum the endpoint enforces.594595        default: false596597    - `ToolResult object`598599      Result returned by a tool invocation.600601      - `type: "tool_result"`602603        default: tool_result604605      - `content: array of object`606607        Text content returned by the tool. Generated files are surfaced via the message's `generated_files` list; other non-text item types (including images and links) are omitted.608609        - `type: "text"`610611          default: text612613        - `text: string`614615          Text returned by the tool616617      - `integration_name: string or null`618619        Name of the integration that provides this tool, when applicable620621      - `is_error: boolean`622623        True when the tool reported an error624625      - `mcp_server_url: string or null`626627        Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable628629      - `name: string`630631        Name of the tool that produced this result632633      - `tool_use_id: string or null`634635        ID of the tool_use block this result responds to636637      - `truncated: boolean`638639        True when one or more text items in `content` were shortened. Pass the endpoint's tool-result max parameter as -1 to request full content, subject to any server-side maximum the endpoint enforces.640641        default: false642643  - `created_at: string`644645    Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block646647    format: date-time648649  - `files: array of object or null`650651    Binary file attachments uploaded by the user. Download via `GET /v1/compliance/apps/chats/files/{claude_file_id}/content`.652653    - `id: string`654655      File ID656657    - `created_at: string`658659      File creation timestamp660661      format: date-time662663    - `filename: string`664665      Display name of the file666667    - `md5: string or null`668669      Lowercase hex MD5 of the file's preferred downloadable variant, as recorded at upload time. Null when no stored hash is available.670671    - `mime_type: string or null`672673      MIME type of the file's preferred downloadable variant (e.g. 'application/pdf')674675    - `size_bytes: number or null`676677      Size in bytes of the file's preferred downloadable variant, if known. Null for older files uploaded before size was recorded.678679  - `generated_files: array of object or null`680681    Downloadable files the assistant created via tool use (e.g. PDF, spreadsheet, slide deck). Distinct from `files`, which are uploads attached to the message. Download via `GET /v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content`.682683    - `id: string`684685      Opaque generated-file id, e.g. 'claude_gen_file_abc123'. Treat as an opaque string; the encoding may change without notice.686687    - `filename: string`688689      Display name of the generated file690691    - `md5: string or null`692693      Lowercase hex MD5 of the generated file, when available. Null when no stored hash is available.694695    - `mime_type: string or null`696697      MIME type reported by the tool that produced the file698699    - `size_bytes: number or null`700701      Size in bytes of the generated file, when available. Null when the file has expired or size is not recorded.702703  - `role: "assistant" or "user"`704705    Message sender (user or assistant)706707    - `"assistant"`708709    - `"user"`710711- `created_at: string`712713  Creation timestamp714715  format: date-time716717- `deleted_at: string or null`718719  Deletion timestamp if deleted720721  format: date-time722723- `first_id: string or null`724725  Opaque pagination cursor for the first message in the current result set. Pass as `before_id` on the next request to page backwards. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.726727- `has_more: boolean`728729  Whether more chat messages exist beyond the current result set. Use `last_id` as `after_id` in a follow-up request to page forward.730731  default: false732733- `href: string`734735  URL to view this chat in claude.ai736737- `last_id: string or null`738739  Opaque pagination cursor for the last message in the current result set. Pass as `after_id` on the next request to page forwards. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.740741- `model: string or null`742743  Model selected for this chat (e.g. 'claude-opus-5'). May be null for legacy chats that never had a model recorded.744745- `name: string`746747  Chat name748749- `organization_uuid: string`750751  Organization UUID this chat belongs to752753- `project_id: string or null`754755  Project ID this chat belongs to756757- `updated_at: string`758759  Last update timestamp760761  format: date-time762763- `user: object or null`764765  The user who created the chat.766767  Null when the API key is restricted to one organization and the creator768  is no longer a member of it (for example, after they were removed from769  it).770771  A key for the whole parent organization returns the creator's `id`772  and current `email_address` for every chat; on the list endpoint, pass773  `organization_ids[]` to keep the results to one organization. For the774  email address the creator had when the chat was created, query775  `GET /v1/compliance/activities` with `activity_types[]=claude_chat_created`776  and a `created_at` window around the chat's `created_at`, find the event777  whose `claude_chat_id` matches this chat's `id`, and read778  `actor.email_address`. These events exist only for chats created after779  compliance logging was enabled for the organization.780781  - `id: string`782783    User identifier784785  - `email_address: string`786787    User's email address788789- `organization_id: string`790791  **Deprecated**792793  Organization ID this chat belongs to794795#### Example796797```bash798curl https://api.anthropic.com/v1/compliance/apps/chats/$CLAUDE_CHAT_ID/messages \799    -H 'anthropic-version: 2023-06-01' \800    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"801```802803##### Response (200)804805```json806{807  "id": "claude_chat_abc123",808  "name": "Product Requirements Discussion",809  "created_at": "2025-06-07T08:09:10Z",810  "updated_at": "2025-06-07T08:09:11Z",811  "organization_id": "org_abc123",812  "organization_uuid": "abcdef01-2345-6789-abcd-ef0123456789",813  "project_id": "claude_proj_xyz789",814  "model": "claude-opus-5",815  "user": {816    "id": "user_xyz456",817    "email_address": "user@example.com"818  },819  "href": "https://claude.ai/chat/abcdef01-2345-6789-abcd-ef0123456789",820  "chat_messages": [821    {822      "id": "claude_chat_msg_abc123",823      "role": "user",824      "created_at": "2025-06-07T08:09:10Z",825      "content": [826        {827          "type": "text",828          "text": "Can you help me draft requirements for our new dashboard feature?"829        }830      ],831      "files": [832        {833          "id": "claude_file_xyz789",834          "filename": "dashboard_mockup_v1.pdf",835          "mime_type": "application/pdf",836          "size_bytes": 12345,837          "md5": "5d41402abc4b2a76b9719d911017c592",838          "created_at": "2025-06-07T08:09:10Z"839        }840      ]841    },842    {843      "id": "claude_chat_msg_def456",844      "role": "assistant",845      "created_at": "2025-06-07T08:09:11Z",846      "content": [847        {848          "type": "text",849          "text": "I'd be happy to help you draft requirements for your dashboard feature..."850        }851      ],852      "artifacts": [853        {854          "id": "claude_artifact_abc123",855          "version_id": "claude_artifact_version_xyz789",856          "title": "Dashboard Requirements Draft",857          "artifact_type": "text/markdown"858        }859      ]860    }861  ],862  "has_more": false,863  "first_id": "eyJtc2dfdXVpZCI6ICIwZjcwYjA2Ni0uLi4ifQ==",864  "last_id": "eyJtc2dfdXVpZCI6ICJhNGUwYjE3Mi0uLi4ifQ=="865}866```867868## Chats › Files869870### Get file metadata871872**GET** `/v1/compliance/apps/chats/files/{claude_file_id}`873874Retrieves metadata for a file referenced in chat messages, without875downloading the file content. Use the sibling `/content` endpoint to876download the bytes.877878#### Path parameters879880- `claude_file_id: string`881882  The file ID (tagged ID, e.g., claude_file_abc123)883884#### Headers885886- `"x-api-key": optional string`887888#### Returns889890- `id: string`891892  File ID893894- `claude_chat_ids: array of string`895896  Chats this file is attached to. A file can be referenced by messages across multiple chats.897898- `created_at: string`899900  File creation timestamp901902  format: date-time903904- `filename: string or null`905906  Display name of the file, if set907908- `md5: string or null`909910  Lowercase hex MD5 of the file's preferred downloadable variant, as recorded at upload time. Null when no stored hash is available. The sibling `/content` endpoint also sets a `Content-MD5` header (base64 per RFC 1864) computed over the exact served bytes; when the two disagree, the header is authoritative.911912- `message_ids: array of string`913914  Chat message IDs this file is attached to. A file can be referenced by multiple messages.915916- `mime_type: string or null`917918  MIME type of the file's preferred downloadable variant (e.g. 'application/pdf'). May be null for files with no downloadable content (e.g. code-interpreter outputs).919920- `size_bytes: number or null`921922  Size in bytes of the file's preferred downloadable variant, if known923924#### Example925926```bash927curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \928    -H 'anthropic-version: 2023-06-01' \929    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"930```931932##### Response (200)933934```json935{936  "id": "claude_file_xyz789",937  "filename": "quarterly_report.pdf",938  "mime_type": "application/pdf",939  "size_bytes": 1048576,940  "md5": "5d41402abc4b2a76b9719d911017c592",941  "created_at": "2024-01-15T10:30:00Z",942  "message_ids": [943    "claude_chat_msg_abc123"944  ],945  "claude_chat_ids": [946    "claude_chat_def456"947  ]948}949```950951### Delete file952953**DELETE** `/v1/compliance/apps/chats/files/{claude_file_id}`954955Permanently deletes a specific file. This is a destructive956operation that cannot be undone.957958#### Path parameters959960- `claude_file_id: string`961962  The file ID (tagged ID, e.g., claude_file_abc123)963964#### Headers965966- `"x-api-key": optional string`967968#### Returns969970- `type: optional "claude_file_deleted"`971972  Constant string confirming deletion973974  default: claude_file_deleted975976- `id: string`977978  The ID of the file that was deleted979980#### Example981982```bash983curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \984    -X DELETE \985    -H 'anthropic-version: 2023-06-01' \986    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"987```988989##### Response (200)990991```json992{993  "id": "claude_file_xyz789",994  "type": "claude_file_deleted"995}996```997998### Download file content9991000**GET** `/v1/compliance/apps/chats/files/{claude_file_id}/content`10011002Downloads the binary content of a file referenced in chat messages.10031004#### Path parameters10051006- `claude_file_id: string`10071008  The file ID (tagged ID, e.g., claude_file_abc123)10091010#### Headers10111012- `"x-api-key": optional string`10131014#### Example10151016```bash1017curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID/content \1018    -H 'anthropic-version: 2023-06-01' \1019    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"1020```10211022## Chats › Generated Files10231024### Get Claude-generated file metadata10251026**GET** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}`10271028Returns metadata for a file the assistant created via tool use.10291030Use the sibling `/content` endpoint to download the bytes.10311032#### Path parameters10331034- `claude_gen_file_id: string`10351036  The generated-file id (e.g., 'claude_gen_file_abc123') as returned in `chat_messages[].generated_files[].id` from GET /apps/chats/{claude_chat_id}/messages.10371038#### Headers10391040- `"x-api-key": optional string`10411042#### Returns10431044- `id: string`10451046  Opaque generated-file id, e.g. 'claude_gen_file_abc123'.10471048- `claude_chat_id: string`10491050  The chat this generated file belongs to10511052- `created_at: string or null`10531054  File creation timestamp, when available10551056  format: date-time10571058- `filename: string`10591060  Display name of the generated file10611062- `md5: string or null`10631064  Lowercase hex MD5 of the stored file. Null when no stored hash is available. The sibling `/content` endpoint also sets a `Content-MD5` header (base64 per RFC 1864) computed over the exact served bytes.10651066- `mime_type: string or null`10671068  MIME type of the stored file, when available10691070- `size_bytes: number or null`10711072  Size in bytes of the stored file, when available10731074#### Example10751076```bash1077curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID \1078    -H 'anthropic-version: 2023-06-01' \1079    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"1080```10811082##### Response (200)10831084```json1085{1086  "id": "id",1087  "claude_chat_id": "claude_chat_id",1088  "created_at": "2019-12-27T18:11:19.117Z",1089  "filename": "filename",1090  "md5": "md5",1091  "mime_type": "mime_type",1092  "size_bytes": 01093}1094```10951096### Download a Claude-generated file10971098**GET** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content`10991100Downloads the binary content of a file the assistant created via tool use.11011102#### Path parameters11031104- `claude_gen_file_id: string`11051106  The generated-file id (e.g., 'claude_gen_file_abc123') as returned in `chat_messages[].generated_files[].id` from GET /apps/chats/{claude_chat_id}/messages.11071108#### Headers11091110- `"x-api-key": optional string`11111112#### Example11131114```bash1115curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID/content \1116    -H 'anthropic-version: 2023-06-01' \1117    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"1118```1119
Files main
Menu

Theme