SPB Git

Repository Public

retrieve.md 2.1 KB 86 lines markdown

1---2title: Get file metadata3url: https://platform.claude.com/docs/en/api/compliance/apps/chats/files/retrieve4---56# Get file metadata78**GET** `/v1/compliance/apps/chats/files/{claude_file_id}`910Retrieves metadata for a file referenced in chat messages, without11downloading the file content. Use the sibling `/content` endpoint to12download the bytes.1314## Path parameters1516- `claude_file_id: string`1718  The file ID (tagged ID, e.g., claude_file_abc123)1920## Headers2122- `"x-api-key": optional string`2324## Returns2526- `id: string`2728  File ID2930- `claude_chat_ids: array of string`3132  Chats this file is attached to. A file can be referenced by messages across multiple chats.3334- `created_at: string`3536  File creation timestamp3738  format: date-time3940- `filename: string or null`4142  Display name of the file, if set4344- `md5: string or null`4546  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.4748- `message_ids: array of string`4950  Chat message IDs this file is attached to. A file can be referenced by multiple messages.5152- `mime_type: string or null`5354  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).5556- `size_bytes: number or null`5758  Size in bytes of the file's preferred downloadable variant, if known5960## Example6162```bash63curl https://api.anthropic.com/v1/compliance/apps/chats/files/$CLAUDE_FILE_ID \64    -H 'anthropic-version: 2023-06-01' \65    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"66```6768### Response (200)6970```json71{72  "id": "claude_file_xyz789",73  "filename": "quarterly_report.pdf",74  "mime_type": "application/pdf",75  "size_bytes": 1048576,76  "md5": "5d41402abc4b2a76b9719d911017c592",77  "created_at": "2024-01-15T10:30:00Z",78  "message_ids": [79    "claude_chat_msg_abc123"80  ],81  "claude_chat_ids": [82    "claude_chat_def456"83  ]84}85```86
Files main
Menu

Theme