Get a file
GET /v1/files/{file_id}
Returns a file’s metadata.
To get the file’s content, see Download a file.
The key must have the files:read capability. For what each capability allows, see Keys.
Path parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file_id | string | Yes | The ID of the file to retrieve. |
Response
Returns 200 with the file object. For every field, see Files.
{ "id": "329409ba-f288-4b44-9c73-14a18150edee", "created_at": "2026-10-21T01:41:11.028Z", "filename": "cities.csv", "mime_type": "text/csv", "size_bytes": 46, "type": "file", "downloadable": true}Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 404 | not_found_error | No file with this ID exists, or this key can’t read it or the session that produced it. Check the ID from the upload or from the list. |
Example
curl -sS "$CONTEXT_BASE_URL/v1/files/329409ba-f288-4b44-9c73-14a18150edee" -H "x-api-key: $CONTEXT_API_KEY"file = client.beta.files.retrieve_metadata("329409ba-f288-4b44-9c73-14a18150edee")const file = await client.beta.files.retrieveMetadata("329409ba-f288-4b44-9c73-14a18150edee")