Repository Public
1---2title: Files3url: https://platform.claude.com/docs/en/api/compliance/apps/chats/files4---56# Files78## Get file metadata910**GET** `/v1/compliance/apps/chats/files/{claude_file_id}`1112Retrieves metadata for a file referenced in chat messages, without13downloading the file content. Use the sibling `/content` endpoint to14download the bytes.1516### Path parameters1718- `claude_file_id: string`1920 The file ID (tagged ID, e.g., claude_file_abc123)2122### Headers2324- `"x-api-key": optional string`2526### Returns2728- `id: string`2930 File ID3132- `claude_chat_ids: array of string`3334 Chats this file is attached to. A file can be referenced by messages across multiple chats.3536- `created_at: string`3738 File creation timestamp3940 format: date-time4142- `filename: string or null`4344 Display name of the file, if set4546- `md5: string or null`4748 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.4950- `message_ids: array of string`5152 Chat message IDs this file is attached to. A file can be referenced by multiple messages.5354- `mime_type: string or null`5556 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).5758- `size_bytes: number or null`5960 Size in bytes of the file's preferred downloadable variant, if known6162### Example6364```bash65curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \66 -H 'anthropic-version: 2023-06-01' \67 -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"68```6970#### Response (200)7172```json73{74 "id": "claude_file_xyz789",75 "filename": "quarterly_report.pdf",76 "mime_type": "application/pdf",77 "size_bytes": 1048576,78 "md5": "5d41402abc4b2a76b9719d911017c592",79 "created_at": "2024-01-15T10:30:00Z",80 "message_ids": [81 "claude_chat_msg_abc123"82 ],83 "claude_chat_ids": [84 "claude_chat_def456"85 ]86}87```8889## Delete file9091**DELETE** `/v1/compliance/apps/chats/files/{claude_file_id}`9293Permanently deletes a specific file. This is a destructive94operation that cannot be undone.9596### Path parameters9798- `claude_file_id: string`99100 The file ID (tagged ID, e.g., claude_file_abc123)101102### Headers103104- `"x-api-key": optional string`105106### Returns107108- `type: optional "claude_file_deleted"`109110 Constant string confirming deletion111112 default: claude_file_deleted113114- `id: string`115116 The ID of the file that was deleted117118### Example119120```bash121curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \122 -X DELETE \123 -H 'anthropic-version: 2023-06-01' \124 -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"125```126127#### Response (200)128129```json130{131 "id": "claude_file_xyz789",132 "type": "claude_file_deleted"133}134```135136## Download file content137138**GET** `/v1/compliance/apps/chats/files/{claude_file_id}/content`139140Downloads the binary content of a file referenced in chat messages.141142### Path parameters143144- `claude_file_id: string`145146 The file ID (tagged ID, e.g., claude_file_abc123)147148### Headers149150- `"x-api-key": optional string`151152### Example153154```bash155curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID/content \156 -H 'anthropic-version: 2023-06-01' \157 -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"158```159160## Domain types161162### File Retrieve Response163164- `FileRetrieveResponse object`165166 File metadata for GET /v1/compliance/apps/chats/files/{claude_file_id}.167168 Returns metadata only. Use the sibling `/content` endpoint to download169 the file bytes.170171 - `id: string`172173 File ID174175 - `claude_chat_ids: array of string`176177 Chats this file is attached to. A file can be referenced by messages across multiple chats.178179 - `created_at: string`180181 File creation timestamp182183 format: date-time184185 - `filename: string or null`186187 Display name of the file, if set188189 - `md5: string or null`190191 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.192193 - `message_ids: array of string`194195 Chat message IDs this file is attached to. A file can be referenced by multiple messages.196197 - `mime_type: string or null`198199 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).200201 - `size_bytes: number or null`202203 Size in bytes of the file's preferred downloadable variant, if known204205### File Delete Response206207- `FileDeleteResponse object`208209 Response for deleting a compliance file.210211 - `type: optional "claude_file_deleted"`212213 Constant string confirming deletion214215 default: claude_file_deleted216217 - `id: string`218219 The ID of the file that was deleted220