SPB Git

Repository Public

list.md 2.5 KB 119 lines markdown

1---2title: List Files3url: https://platform.claude.com/docs/en/api/files/list4---56# List Files78**GET** `/v1/files`910List Files1112## Query parameters1314- `ids: optional array of string`1516  Restrict the result set to Files whose `id` is in this list. At most 100 entries (after de-duplication). Mutually exclusive with `page` and `limit`. When supplied, the response is always a single page (`next_page` is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.1718- `limit: optional number`1920  Number of items to return per page.2122  Defaults to `20`. Ranges from `1` to `1000`.2324  default: 20, maximum: 1000, minimum: 12526- `page: optional string`2728  Opaque page cursor returned in a prior list response's `next_page`. Prefixed `page_`.2930## Headers3132- `"anthropic-workspace-id": optional string`3334## Returns3536- `data: array of FileMetadata`3738  List of file metadata objects.3940  - `type: "file"`4142    Object type.4344    For files, this is always `"file"`.4546  - `id: string`4748    Unique object identifier.4950    The format and length of IDs may change over time.5152  - `created_at: string`5354    RFC 3339 datetime string representing when the file was created.5556    format: date-time5758  - `filename: string`5960    Original filename of the uploaded file.6162    maxLength: 500, minLength: 16364  - `mime_type: string`6566    MIME type of the file.6768    maxLength: 255, minLength: 16970  - `size_bytes: number`7172    Size of the file in bytes.7374    minimum: 07576  - `downloadable: optional boolean`7778    Whether the file can be downloaded.7980    default: false8182  - `expires_at: optional string or null`8384    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.8586    format: date-time8788- `next_page: optional string or null`8990  Opaque cursor for the next page. Supply as `?page=` to fetch the next page; null when there are no more results.9192## Example9394```bash95curl https://api.anthropic.com/v1/files \96    -H 'anthropic-version: 2023-06-01' \97    -H "X-Api-Key: $ANTHROPIC_API_KEY"98```99100### Response (200)101102```json103{104  "data": [105    {106      "id": "file_011CNha8iCJcU1wXNR6q4V8w",107      "created_at": "2025-04-15T18:37:24.100435Z",108      "filename": "document.pdf",109      "mime_type": "application/pdf",110      "size_bytes": 102400,111      "type": "file",112      "downloadable": false,113      "expires_at": "2025-05-15T18:37:24.100435Z"114    }115  ],116  "next_page": "next_page"117}118```119
Files main
Menu

Theme