Claude Platform Docs

To enable the Compliance API, see the setup guide.

Set up the Compliance API

文件

获取文件元数据
GET/v1/compliance/apps/chats/files/{claude_file_id}

检索对话消息中引用的文件的元数据,而不下载文件内容。使用同级的 /content 端点下载字节内容。

删除文件
DELETE/v1/compliance/apps/chats/files/{claude_file_id}

永久删除特定文件。这是一个破坏性操作,无法撤销。

下载文件内容
GET/v1/compliance/apps/chats/files/{claude_file_id}/content

下载对话消息中引用的文件的二进制内容。

Models
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

formatdate-time
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

FileDeleteResponse object{ type: "claude_file_deleted", id }

Response for deleting a compliance file.

type: optional "claude_file_deleted"

Constant string confirming deletion

defaultclaude_file_deleted
id: string

The ID of the file that was deleted