Get a file
⚠️
Preview — this feature is being built; the design below is the spec.
GET https://app.syntic.ai/v1/files/{file_id}Return one file’s details, including its processing status. Poll this after an upload if you need the file to be ready before using it; requests that reference a processing file also wait up to 30 seconds on their own.
For how this fits into a full workflow, see Files API.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <key>: a private inference key (sk_live_...). See Authentication. |
Path parameters
| Parameter | Type | Description |
|---|---|---|
file_id | string | The file’s id, starting with file_. |
Response
200 OK, Content-Type: application/json
{
"id": "file_01JBW9Q6RZ",
"object": "file",
"filename": "lease.pdf",
"purpose": "document",
"bytes": 482113,
"mime_type": "application/pdf",
"created_at": 1791820800,
"expires_at": 1794412800,
"status": "ready",
"source": "upload",
"workspace_id": "wrkspc_01JC0A2C4E6G8J0L2N4Q"
}| Field | Type | Description |
|---|---|---|
id | string | Starts with file_. Use it wherever a request accepts a file_id. |
object | string | Always file. |
filename | string | The name sent with the upload, or the name Syntic gave a generated file. |
purpose | string | document, vision, batch, code_input or skill. |
bytes | integer | Size in bytes. |
mime_type | string | Detected media type. |
created_at | integer | Unix seconds. |
expires_at | integer | Unix seconds when the file is deleted. Every file expires. |
status | string | processing (being scanned and prepared), ready, or failed with status_detail. |
source | string | upload, batch_output or code_execution. |
workspace_id | string | The workspace that owns the file. |
Examples
curl -sS https://app.syntic.ai/v1/files/file_01JBW9Q6RZ \
-H "Authorization: Bearer $SYNTIC_API_KEY"Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 404 | not_found_error | file_not_found | Unknown id, expired, deleted, or in another workspace. The response never says which. |
| 401 | authentication_error | invalid_api_key | The key is missing, unknown, revoked or expired. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Related
Was this page helpful?