SPB Git

Repository Public

retrieve_metadata.md 1.7 KB 96 lines markdown

1---2title: Get File Metadata3url: https://platform.claude.com/docs/en/api/files/retrieve_metadata4---56# Get File Metadata78**GET** `/v1/files/{file_id}`910Get File Metadata1112## Path parameters1314- `file_id: string`1516  ID of the File.1718## Headers1920- `"anthropic-workspace-id": optional string`2122## Returns2324- `FileMetadata object`2526  - `type: "file"`2728    Object type.2930    For files, this is always `"file"`.3132  - `id: string`3334    Unique object identifier.3536    The format and length of IDs may change over time.3738  - `created_at: string`3940    RFC 3339 datetime string representing when the file was created.4142    format: date-time4344  - `filename: string`4546    Original filename of the uploaded file.4748    maxLength: 500, minLength: 14950  - `mime_type: string`5152    MIME type of the file.5354    maxLength: 255, minLength: 15556  - `size_bytes: number`5758    Size of the file in bytes.5960    minimum: 06162  - `downloadable: optional boolean`6364    Whether the file can be downloaded.6566    default: false6768  - `expires_at: optional string or null`6970    RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.7172    format: date-time7374## Example7576```bash77curl https://api.anthropic.com/v1/files/$FILE_ID \78    -H 'anthropic-version: 2023-06-01' \79    -H "X-Api-Key: $ANTHROPIC_API_KEY"80```8182### Response (200)8384```json85{86  "id": "file_011CNha8iCJcU1wXNR6q4V8w",87  "created_at": "2025-04-15T18:37:24.100435Z",88  "filename": "document.pdf",89  "mime_type": "application/pdf",90  "size_bytes": 102400,91  "type": "file",92  "downloadable": false,93  "expires_at": "2025-05-15T18:37:24.100435Z"94}95```96
Files main
Menu

Theme