Chats
api/compliance/apps/chats
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/compliance/apps/chats Changed · +555 / -769 lines
### Query parameters ### Headers #### Response (200) ### Path parameters ### Headers #### Response (200) ## Domain types ## Chats › Messages ### Get chat messages #### Path parameters #### Query parameters #### Headers #### Returns #### Example ##### Response (200) ## Chats › Files ### Get file metadata #### Path parameters #### Headers #### Returns #### Example ##### Response (200) ### Delete file #### Path parameters #### Headers #### Returns #### Example ##### Response (200) ### Download file content #### Path parameters #### Headers #### Example ## Chats › Generated Files ### Get Claude-generated file metadata #### Path parameters #### Headers #### Returns #### Example ##### Response (200) ### Download a Claude-generated file #### Path parameters #### Headers #### Example ### Query Parameters ### Header Parameters #### Response ### Path Parameters ### Header Parameters #### Response ## Domain Types # Messages ## Get chat messages ### Path Parameters ### Query Parameters ### Header Parameters #### Response ## Domain Types ### Message List Response # Files ## Get file metadata ### Path Parameters ### Header Parameters #### Response ## Delete file ### Path Parameters ### Header Parameters #### Response ## Download file content ### Path Parameters ### Header Parameters ## Domain Types ### File Retrieve Response ### File Delete Response # Generated Files ## Get Claude-generated file metadata ### Path Parameters ### Header Parameters #### Response ## Download a Claude-generated file ### Path Parameters ### Header Parameters ## Domain Types ### Generated File Retrieve Response
The two sides of this change are too far apart to line up, so this is the differ's own diff of it.
---- -title: Chats -url: https://platform.claude.com/docs/en/api/compliance/apps/chats ---- - # Chats ## List chats -**get** `/v1/compliance/apps/chats` +**GET** `/v1/compliance/apps/chats` Lists chat metadata with filtering capabilities for targeted compliance review. Results are sorted chronologically (time ascending)
no time filter) with the default `order_by`. `user_ids[]` with `order_by=updated_at` is already rejected. -### Query Parameters +### Query parameters - `after_id: optional string`
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. -- `created_at: optional object { gt, gte, lt, lte }` +- `created_at: optional object` - `gt: optional string` Filter chats created after this time (RFC 3339 format) + format: date-time + - `gte: optional string` Filter chats created at or after this time (RFC 3339 format) + format: date-time + - `lt: optional string` Filter chats created before this time (RFC 3339 format) + format: date-time + - `lte: optional string` Filter chats created at or before this time (RFC 3339 format) + format: date-time + - `limit: optional number` Maximum results (default: 100, max: 1000) + default: 100, maximum: 1000, minimum: 1 + - `order_by: optional "created_at" or "updated_at"` 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`. + default: created_at + - `"created_at"` - `"updated_at"`
Filter by project IDs (accepts `claude_proj_...`). Enumerate IDs via `GET /v1/compliance/apps/projects`. Requires user_ids[]; not supported for org-wide queries. -- `updated_at: optional object { gt, gte, lt, lte }` +- `updated_at: optional object` - `gt: optional string` 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. + format: date-time + - `gte: optional string` 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. + format: date-time + - `lt: optional string` 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. + format: date-time + - `lte: optional string` 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. + format: date-time + - `user_ids: optional array of string` 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. -### Header Parameters + maxItems: 10 + +### Headers - `"x-api-key": optional string` ### Returns -- `data: array of object { id, created_at, deleted_at, 8 more }` +- `data: array of object` List of chat metadata sorted chronologically by the request's `order_by` key (default `created_at`), tie break by id
Creation timestamp + format: date-time + - `deleted_at: string or null` Deletion timestamp if deleted + format: date-time + - `href: string` URL to view this chat in claude.ai
Chat name/title + - `organization_uuid: string` + + Organization UUID this chat belongs to + + - `project_id: string or null` + + Project ID this chat belongs to + + - `updated_at: string` + + Last update timestamp + + format: date-time + + - `user: object or null` + + User information for compliance responses. + + - `id: string` + + User identifier + + - `email_address: string` + + User's email address + - `organization_id: string` + **Deprecated** + Organization ID this chat belongs to - - `organization_uuid: string` - - Organization UUID this chat belongs to - - - `project_id: string or null` - - Project ID this chat belongs to - - - `updated_at: string` - - Last update timestamp - - - `user: object { id, email_address } or null` - - User information for compliance responses. - - - `id: string` - - User identifier - - - `email_address: string` - - User's email address - - `first_id: string or null` 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.
### Example -```http +```bash curl https://api.anthropic.com/v1/compliance/apps/chats \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +#### Response (200) ```json {
## Delete chat -**delete** `/v1/compliance/apps/chats/{claude_chat_id}` +**DELETE** `/v1/compliance/apps/chats/{claude_chat_id}` Permanently deletes a chat and all associated messages and files. This is a destructive operation that cannot be undone. -### Path Parameters +### Path parameters - `claude_chat_id: string` The chat ID (tagged ID, e.g., claude_chat_abc123) -### Header Parameters +### Headers - `"x-api-key": optional string`
Constant string confirming deletion - - `"claude_chat_deleted"` + default: claude_chat_deleted ### Example -```http +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/$CLAUDE_CHAT_ID \ -X DELETE \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +#### Response (200) ```json {
} ``` -## Domain Types +## Domain types ### Chat List Response -- `ChatListResponse object { id, created_at, deleted_at, 8 more }` +- `ChatListResponse object` Chat metadata for listing chats (without messages).
Creation timestamp + format: date-time + - `deleted_at: string or null` Deletion timestamp if deleted + format: date-time + - `href: string` URL to view this chat in claude.ai
Chat name/title + - `organization_uuid: string` + + Organization UUID this chat belongs to + + - `project_id: string or null` + + Project ID this chat belongs to + + - `updated_at: string` + + Last update timestamp + + format: date-time + + - `user: object or null` + + User information for compliance responses. + + - `id: string` + + User identifier + + - `email_address: string` + + User's email address + - `organization_id: string` + **Deprecated** + Organization ID this chat belongs to - - `organization_uuid: string` - - Organization UUID this chat belongs to - - - `project_id: string or null` - - Project ID this chat belongs to - - - `updated_at: string` - - Last update timestamp - - - `user: object { id, email_address } or null` - - User information for compliance responses. +### Chat Delete Response + +- `ChatDeleteResponse object` + + Response for deleting a Claude chat. + + - `id: string` + + The ID of the Claude chat that was deleted + + - `type: optional "claude_chat_deleted"` + + Constant string confirming deletion + + default: claude_chat_deleted + +## Chats › Messages + +### Get chat messages + +**GET** `/v1/compliance/apps/chats/{claude_chat_id}/messages` + +Retrieves message history and file metadata for a specific chat. + +#### Path parameters + +- `claude_chat_id: string` + + The chat ID (tagged ID, e.g., claude_chat_abc123) + +#### Query parameters + +- `after_id: optional string` + + 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. + +- `before_id: optional string` + + 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. + +- `created_at: optional object` + + - `gt: optional string` + + Filter messages created after this time (RFC 3339 format) + + format: date-time + + - `gte: optional string` + + Filter messages created at or after this time (RFC 3339 format) + + format: date-time + + - `lt: optional string` + + Filter messages created before this time (RFC 3339 format) + + format: date-time + + - `lte: optional string` + + Filter messages created at or before this time (RFC 3339 format) + + format: date-time + +- `limit: optional number` + + Maximum results (max: 1000). When omitted, the full result set is returned in one response. + + maximum: 1000, minimum: 1 + +- `order: optional "asc" or "desc"` + + Sort direction for messages within the response. `asc` (the default) returns oldest-first; `desc` returns newest-first. + + default: asc + + - `"asc"` + + - `"desc"` + +- `tool_result_max_chars: optional number` + + 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. + + default: 10000, minimum: -1 + +- `tool_use_input_max_chars: optional number` + + 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. + + default: 10000, minimum: -1 + +- `updated_at: optional object` + + - `gt: optional string` + + Filter messages updated after this time (RFC 3339 format) + + format: date-time + + - `gte: optional string` + + Filter messages updated at or after this time (RFC 3339 format) + + format: date-time + + - `lt: optional string` + + Filter messages updated before this time (RFC 3339 format) + + format: date-time + + - `lte: optional string` + + Filter messages updated at or before this time (RFC 3339 format) + + format: date-time + +#### Headers + +- `"x-api-key": optional string` + +#### Returns + +- `id: string` + + Chat ID + +- `chat_messages: array of object` + + Array of chat messages in order of created_at + + - `id: string` + + Unique identifier for the message e.g. 'claude_chat_msg_abcd1234' + + - `artifacts: array of object or null` + + Versioned documents generated or updated by the assistant in this message. Download via `GET /v1/compliance/apps/artifacts/{artifact_version_id}/content`. - `id: string` - User identifier - - - `email_address: string` - - User's email address - -### Chat Delete Response - -- `ChatDeleteResponse object { id, type }` - - Response for deleting a Claude chat. + Artifact ID e.g. 'claude_artifact_abc123' + + - `artifact_type: string or null` + + MIME-like artifact type e.g. 'application/vnd.ant.code' + + - `title: string or null` + + Artifact title + + - `version_id: string` + + Artifact version ID e.g. 'claude_artifact_version_abc123' + + - `content: array of object or object or object` + + Content blocks within the message + + - `Text object` + + Text content block. + + - `text: string` + + Text content from human or assistant + + - `thinking_redacted: boolean` + + 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. + + default: false + + - `truncated: boolean` + + True when `text` was shortened by the server's fixed per-string bound (1 MiB). Always false on chat text blocks. + + default: false + + - `type: "text"` + + default: text + + - `ToolUse object` + + Tool invocation requested by the assistant. + + - `id: string or null` + + Tool-use ID, e.g. 'toolu_01AbC...' + + - `input: string` + + Arguments passed to the tool, as a JSON-encoded string. May be shortened — see the `truncated` field + + - `integration_name: string or null` + + Name of the integration that provides this tool, when applicable + + - `mcp_server_url: string or null` + + Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable + + - `name: string` + + Name of the tool invoked + + - `truncated: boolean` + + 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. + + default: false + + - `type: "tool_use"` + + default: tool_use + + - `ToolResult object` + + Result returned by a tool invocation. + + - `content: array of object` + + 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. + + - `text: string` + + Text returned by the tool + + - `type: "text"` + + default: text + + - `integration_name: string or null` + + Name of the integration that provides this tool, when applicable + + - `is_error: boolean` + + True when the tool reported an error + + - `mcp_server_url: string or null` + + Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable + + - `name: string` + + Name of the tool that produced this result + + - `tool_use_id: string or null` + + ID of the tool_use block this result responds to + + - `truncated: boolean` + + 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. + + default: false + + - `type: "tool_result"` + + default: tool_result + + - `created_at: string` + + Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block + + format: date-time + + - `files: array of object or null` + + Binary file attachments uploaded by the user. Download via `GET /v1/compliance/apps/chats/files/{claude_file_id}/content`. + + - `id: string` + + File ID + + - `created_at: string` + + File creation timestamp + + format: date-time + + - `filename: string` + + Display name of the file + + - `md5: string or null` + + Lowercase hex MD5 of the file's preferred downloadable variant, as recorded at upload time. Null when no stored hash is available. + + - `mime_type: string or null` + + MIME type of the file's preferred downloadable variant (e.g. 'application/pdf') + + - `size_bytes: number or null` + + Size in bytes of the file's preferred downloadable variant, if known. Null for older files uploaded before size was recorded. + + - `generated_files: array of object or null` + + 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`. + + - `id: string` + + Opaque generated-file id, e.g. 'claude_gen_file_abc123'. Treat as an opaque string; the encoding may change without notice. + + - `filename: string` + + Display name of the generated file + + - `md5: string or null` + + Lowercase hex MD5 of the generated file, when available. Null when no stored hash is available. + + - `mime_type: string or null` + + MIME type reported by the tool that produced the file + + - `size_bytes: number or null` + + Size in bytes of the generated file, when available. Null when the file has expired or size is not recorded. + + - `role: "assistant" or "user"` + + Message sender (user or assistant) + + - `"assistant"` + + - `"user"` + +- `created_at: string` + + Creation timestamp + + format: date-time + +- `deleted_at: string or null` + + Deletion timestamp if deleted + + format: date-time + +- `first_id: string or null` + + 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. + +- `has_more: boolean` + + Whether more chat messages exist beyond the current result set. Use `last_id` as `after_id` in a follow-up request to page forward. + + default: false + +- `href: string` + + URL to view this chat in claude.ai + +- `last_id: string or null` + + 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. + +- `model: string or null` + + Model selected for this chat (e.g. 'claude-opus-5'). May be null for legacy chats that never had a model recorded. + +- `name: string` + + Chat name + +- `organization_uuid: string` + + Organization UUID this chat belongs to + +- `project_id: string or null` + + Project ID this chat belongs to + +- `updated_at: string` + + Last update timestamp + + format: date-time + +- `user: object or null` + + User information for compliance responses. - `id: string` - The ID of the Claude chat that was deleted - - - `type: optional "claude_chat_deleted"` - - Constant string confirming deletion - - - `"claude_chat_deleted"` - -# Messages - -## Get chat messages - -**get** `/v1/compliance/apps/chats/{claude_chat_id}/messages` - -Retrieves message history and file metadata for a specific chat. - -### Path Parameters - -- `claude_chat_id: string` - - The chat ID (tagged ID, e.g., claude_chat_abc123) - -### Query Parameters - -- `after_id: optional string` - - 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. - -- `before_id: optional string` - - 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. - -- `created_at: optional object { gt, gte, lt, lte }` - - - `gt: optional string` - - Filter messages created after this time (RFC 3339 format) - - - `gte: optional string` - - Filter messages created at or after this time (RFC 3339 format) - - - `lt: optional string` - - Filter messages created before this time (RFC 3339 format) - - - `lte: optional string` - - Filter messages created at or before this time (RFC 3339 format) - -- `limit: optional number` - - Maximum results (max: 1000). When omitted, the full result set is returned in one response. - -- `order: optional "asc" or "desc"` - - Sort direction for messages within the response. `asc` (the default) returns oldest-first; `desc` returns newest-first. - - - `"asc"` - - - `"desc"` - -- `tool_result_max_chars: optional number` - - 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. - -- `tool_use_input_max_chars: optional number` - - 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. - -- `updated_at: optional object { gt, gte, lt, lte }` - - - `gt: optional string` - - Filter messages updated after this time (RFC 3339 format) - - - `gte: optional string` - - Filter messages updated at or after this time (RFC 3339 format) - - - `lt: optional string` - - Filter messages updated before this time (RFC 3339 format) - - - `lte: optional string` - - Filter messages updated at or before this time (RFC 3339 format) - -### Header Parameters - -- `"x-api-key": optional string` - -### Returns - -- `id: string` - - Chat ID - -- `chat_messages: array of object { id, artifacts, content, 4 more }` - - Array of chat messages in order of created_at - - - `id: string` - - Unique identifier for the message e.g. 'claude_chat_msg_abcd1234' - - - `artifacts: array of object { id, artifact_type, title, version_id } or null` - - Versioned documents generated or updated by the assistant in this message. Download via `GET /v1/compliance/apps/artifacts/{artifact_version_id}/content`. - - - `id: string` - - Artifact ID e.g. 'claude_artifact_abc123' - - - `artifact_type: string or null` - - MIME-like artifact type e.g. 'application/vnd.ant.code' - - - `title: string or null` - - Artifact title - - - `version_id: string` - - Artifact version ID e.g. 'claude_artifact_version_abc123' - - - `content: array of object { text, thinking_redacted, truncated, type } or object { id, input, integration_name, 4 more } or object { content, integration_name, is_error, 5 more }` - - Content blocks within the message - - - `Text object { text, thinking_redacted, truncated, type }` - - Text content block. - - - `text: string` - - Text content from human or assistant - - - `thinking_redacted: boolean` - - 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. - - - `truncated: boolean` - - True when `text` was shortened by the server's fixed per-string bound (1 MiB). Always false on chat text blocks. - - - `type: "text"` - - - `"text"` - - - `ToolUse object { id, input, integration_name, 4 more }` - - Tool invocation requested by the assistant. - - - `id: string or null` - - Tool-use ID, e.g. 'toolu_01AbC...' - - - `input: string` - - Arguments passed to the tool, as a JSON-encoded string. May be shortened — see the `truncated` field - - - `integration_name: string or null` - - Name of the integration that provides this tool, when applicable - - - `mcp_server_url: string or null` - - Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable - - - `name: string` - - Name of the tool invoked - - - `truncated: boolean` - - 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. - - - `type: "tool_use"` - - - `"tool_use"` - - - `ToolResult object { content, integration_name, is_error, 5 more }` - - Result returned by a tool invocation. - - - `content: array of object { text, type }` - - 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. - - - `text: string` - - Text returned by the tool - - - `type: "text"` - - - `"text"` - - - `integration_name: string or null` - - Name of the integration that provides this tool, when applicable - - - `is_error: boolean` - - True when the tool reported an error - - - `mcp_server_url: string or null` - - Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable - - - `name: string` - - Name of the tool that produced this result - - - `tool_use_id: string or null` - - ID of the tool_use block this result responds to - - - `truncated: boolean` - - 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. - - - `type: "tool_result"` - - - `"tool_result"` - - - `created_at: string` - - Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block - - - `files: array of object { id, created_at, filename, 3 more } or null` - - Binary file attachments uploaded by the user. Download via `GET /v1/compliance/apps/chats/files/{claude_file_id}/content`. - - - `id: string` - - File ID - - - `created_at: string` - - File creation timestamp - - - `filename: string` - - Display name of the file - - - `md5: string or null` - - Lowercase hex MD5 of the file's preferred downloadable variant, as recorded at upload time. Null when no stored hash is available. - - - `mime_type: string or null` - - MIME type of the file's preferred downloadable variant (e.g. 'application/pdf') - - - `size_bytes: number or null` - - Size in bytes of the file's preferred downloadable variant, if known. Null for older files uploaded before size was recorded. - - - `generated_files: array of object { id, filename, md5, 2 more } or null` - - 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`. - - - `id: string` - - Opaque generated-file id, e.g. 'claude_gen_file_abc123'. Treat as an opaque string; the encoding may change without notice. - - - `filename: string` - - Display name of the generated file - - - `md5: string or null` - - Lowercase hex MD5 of the generated file, when available. Null when no stored hash is available. - - - `mime_type: string or null` - - MIME type reported by the tool that produced the file - - - `size_bytes: number or null` - - Size in bytes of the generated file, when available. Null when the file has expired or size is not recorded. - - - `role: "assistant" or "user"` - - Message sender (user or assistant) - - - `"assistant"` - - - `"user"` - -- `created_at: string` - - Creation timestamp - -- `deleted_at: string or null` - - Deletion timestamp if deleted - -- `first_id: string or null` - - 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. - -- `has_more: boolean` - - Whether more chat messages exist beyond the current result set. Use `last_id` as `after_id` in a follow-up request to page forward. - -- `href: string` - - URL to view this chat in claude.ai - -- `last_id: string or null` - - 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. - -- `model: string or null` - - Model selected for this chat (e.g. 'claude-opus-5'). May be null for legacy chats that never had a model recorded. - -- `name: string` - - Chat name + User identifier + + - `email_address: string` + + User's email address - `organization_id: string` + **Deprecated** + Organization ID this chat belongs to -- `organization_uuid: string` - - Organization UUID this chat belongs to - -- `project_id: string or null` - - Project ID this chat belongs to - -- `updated_at: string` - - Last update timestamp - -- `user: object { id, email_address } or null` - - User information for compliance responses. - - - `id: string` - - User identifier - - - `email_address: string` - - User's email address - -### Example - -```http +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/$CLAUDE_CHAT_ID/messages \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +##### Response (200) ```json {
} ``` -## Domain Types - -### Message List Response - -- `MessageListResponse object { id, artifacts, content, 4 more }` - - A single message in a chat conversation. - - - `id: string` - - Unique identifier for the message e.g. 'claude_chat_msg_abcd1234' - - - `artifacts: array of object { id, artifact_type, title, version_id } or null` - - Versioned documents generated or updated by the assistant in this message. Download via `GET /v1/compliance/apps/artifacts/{artifact_version_id}/content`. - - - `id: string` - - Artifact ID e.g. 'claude_artifact_abc123' - - - `artifact_type: string or null` - - MIME-like artifact type e.g. 'application/vnd.ant.code' - - - `title: string or null` - - Artifact title - - - `version_id: string` - - Artifact version ID e.g. 'claude_artifact_version_abc123' - - - `content: array of object { text, thinking_redacted, truncated, type } or object { id, input, integration_name, 4 more } or object { content, integration_name, is_error, 5 more }` - - Content blocks within the message - - - `Text object { text, thinking_redacted, truncated, type }` - - Text content block. - - - `text: string` - - Text content from human or assistant - - - `thinking_redacted: boolean` - - 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. - - - `truncated: boolean` - - True when `text` was shortened by the server's fixed per-string bound (1 MiB). Always false on chat text blocks. - - - `type: "text"` - - - `"text"` - - - `ToolUse object { id, input, integration_name, 4 more }` - - Tool invocation requested by the assistant. - - - `id: string or null` - - Tool-use ID, e.g. 'toolu_01AbC...' - - - `input: string` - - Arguments passed to the tool, as a JSON-encoded string. May be shortened — see the `truncated` field - - - `integration_name: string or null` - - Name of the integration that provides this tool, when applicable - - - `mcp_server_url: string or null` - - Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable - - - `name: string` - - Name of the tool invoked - - - `truncated: boolean` - - 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. - - - `type: "tool_use"` - - - `"tool_use"` - - - `ToolResult object { content, integration_name, is_error, 5 more }` - - Result returned by a tool invocation. - - - `content: array of object { text, type }` - - 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. - - - `text: string` - - Text returned by the tool - - - `type: "text"` - - - `"text"` - - - `integration_name: string or null` - - Name of the integration that provides this tool, when applicable - - - `is_error: boolean` - - True when the tool reported an error - - - `mcp_server_url: string or null` - - Base URL (scheme, host, and path only) of the MCP server that provides this tool, when applicable - - - `name: string` - - Name of the tool that produced this result - - - `tool_use_id: string or null` - - ID of the tool_use block this result responds to - - - `truncated: boolean` - - 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. - - - `type: "tool_result"` - - - `"tool_result"` - - - `created_at: string` - - Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block - - - `files: array of object { id, created_at, filename, 3 more } or null` - - Binary file attachments uploaded by the user. Download via `GET /v1/compliance/apps/chats/files/{claude_file_id}/content`. - - - `id: string` - - File ID - - - `created_at: string` - - File creation timestamp - - - `filename: string` - - Display name of the file - - - `md5: string or null` - - Lowercase hex MD5 of the file's preferred downloadable variant, as recorded at upload time. Null when no stored hash is available. - - - `mime_type: string or null` - - MIME type of the file's preferred downloadable variant (e.g. 'application/pdf') - - - `size_bytes: number or null` - - Size in bytes of the file's preferred downloadable variant, if known. Null for older files uploaded before size was recorded. - - - `generated_files: array of object { id, filename, md5, 2 more } or null` - - 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`. - - - `id: string` - - Opaque generated-file id, e.g. 'claude_gen_file_abc123'. Treat as an opaque string; the encoding may change without notice. - - - `filename: string` - - Display name of the generated file - - - `md5: string or null` - - Lowercase hex MD5 of the generated file, when available. Null when no stored hash is available. - - - `mime_type: string or null` - - MIME type reported by the tool that produced the file - - - `size_bytes: number or null` - - Size in bytes of the generated file, when available. Null when the file has expired or size is not recorded. - - - `role: "assistant" or "user"` - - Message sender (user or assistant) - - - `"assistant"` - - - `"user"` - -# Files - -## Get file metadata - -**get** `/v1/compliance/apps/chats/files/{claude_file_id}` +## Chats › Files + +### Get file metadata + +**GET** `/v1/compliance/apps/chats/files/{claude_file_id}` Retrieves metadata for a file referenced in chat messages, without downloading the file content. Use the sibling `/content` endpoint to download the bytes. -### Path Parameters +#### Path parameters - `claude_file_id: string` The file ID (tagged ID, e.g., claude_file_abc123) -### Header Parameters +#### Headers - `"x-api-key": optional string` -### Returns +#### Returns - `id: string`
File creation timestamp + format: date-time + - `filename: string or null` Display name of the file, if set
Size in bytes of the file's preferred downloadable variant, if known -### Example - -```http +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +##### Response (200) ```json {
} ``` -## Delete file - -**delete** `/v1/compliance/apps/chats/files/{claude_file_id}` +### Delete file + +**DELETE** `/v1/compliance/apps/chats/files/{claude_file_id}` Permanently deletes a specific file. This is a destructive operation that cannot be undone. -### Path Parameters +#### Path parameters - `claude_file_id: string` The file ID (tagged ID, e.g., claude_file_abc123) -### Header Parameters +#### Headers - `"x-api-key": optional string` -### Returns +#### Returns - `id: string`
Constant string confirming deletion - - `"claude_file_deleted"` - -### Example - -```http + default: claude_file_deleted + +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \ -X DELETE \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +##### Response (200) ```json {
} ``` -## Download file content - -**get** `/v1/compliance/apps/chats/files/{claude_file_id}/content` +### Download file content + +**GET** `/v1/compliance/apps/chats/files/{claude_file_id}/content` Downloads the binary content of a file referenced in chat messages. -### Path Parameters +#### Path parameters - `claude_file_id: string` The file ID (tagged ID, e.g., claude_file_abc123) -### Header Parameters +#### Headers - `"x-api-key": optional string` -### Example - -```http +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID/content \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -## Domain Types - -### File Retrieve Response - -- `FileRetrieveResponse object { id, claude_chat_ids, created_at, 5 more }` - - File metadata for GET /v1/compliance/apps/chats/files/{claude_file_id}. - - Returns metadata only. Use the sibling `/content` endpoint to download - the file bytes. - - - `id: string` - - File ID - - - `claude_chat_ids: array of string` - - Chats this file is attached to. A file can be referenced by messages across multiple chats. - - - `created_at: string` - - File creation timestamp - - - `filename: string or null` - - Display name of the file, if set - - - `md5: string or null` - - 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. - - - `message_ids: array of string` - - Chat message IDs this file is attached to. A file can be referenced by multiple messages. - - - `mime_type: string or null` - - 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). - - - `size_bytes: number or null` - - Size in bytes of the file's preferred downloadable variant, if known - -### File Delete Response - -- `FileDeleteResponse object { id, type }` - - Response for deleting a compliance file. - - - `id: string` - - The ID of the file that was deleted - - - `type: optional "claude_file_deleted"` - - Constant string confirming deletion - - - `"claude_file_deleted"` - -# Generated Files - -## Get Claude-generated file metadata - -**get** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}` +## Chats › Generated Files + +### Get Claude-generated file metadata + +**GET** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}` Returns metadata for a file the assistant created via tool use. Use the sibling `/content` endpoint to download the bytes. -### Path Parameters +#### Path parameters - `claude_gen_file_id: string` 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. -### Header Parameters +#### Headers - `"x-api-key": optional string` -### Returns +#### Returns - `id: string`
File creation timestamp, when available + format: date-time + - `filename: string` Display name of the generated file
Size in bytes of the stored file, when available -### Example - -```http +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` -#### Response +##### Response (200) ```json {
} ``` -## Download a Claude-generated file - -**get** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content` +### Download a Claude-generated file + +**GET** `/v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content` Downloads the binary content of a file the assistant created via tool use. -### Path Parameters +#### Path parameters - `claude_gen_file_id: string` 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. -### Header Parameters +#### Headers - `"x-api-key": optional string` -### Example - -```http +#### Example + +```bash curl https://api.anthropic.com/v1/compliance/apps/chats/generated-files/$CLAUDE_GEN_FILE_ID/content \ -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY" ``` - -## Domain Types - -### Generated File Retrieve Response - -- `GeneratedFileRetrieveResponse object { id, claude_chat_id, created_at, 4 more }` - - Metadata for GET /v1/compliance/apps/chats/generated-files/{claude_gen_file_id}. - - Returns metadata only. Use the sibling `/content` endpoint to download - the bytes. The owning chat is included since the id is opaque; to find the - specific message that produced the file, fetch - `/v1/compliance/apps/chats/{claude_chat_id}/messages` and match on - `generated_files[].id`. - - - `id: string` - - Opaque generated-file id, e.g. 'claude_gen_file_abc123'. - - - `claude_chat_id: string` - - The chat this generated file belongs to - - - `created_at: string or null` - - File creation timestamp, when available - - - `filename: string` - - Display name of the generated file - - - `md5: string or null` - - 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. - - - `mime_type: string or null` - - MIME type of the stored file, when available - - - `size_bytes: number or null` - - Size in bytes of the stored file, when available