List files
⚠️
Preview — this feature is being built; the design below is the spec.
GET https://app.syntic.ai/v1/filesReturn the files in the key’s workspace, newest first, one page at a time.
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. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
purpose | string | Only files with this purpose. | |
limit | integer | 20 | 1 to 100. |
after_id | string | Return files after this id: pass the previous page’s last_id. | |
before_id | string | Return files before this id (the previous page). |
Response
200 OK, Content-Type: application/json
{
"data": [
{
"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"
}
],
"has_more": false,
"first_id": "file_01JBW9Q6RZ",
"last_id": "file_01JBW9Q6RZ"
}Each item is a file object. Keep requesting with after_id set to last_id until has_more is false.
Examples
curl -sS "https://app.syntic.ai/v1/files?purpose=document&limit=20" \
-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 |
|---|---|---|---|
| 400 | invalid_request_error | invalid_purpose | Unknown purpose filter. |
| 400 | invalid_request_error | invalid_parameter | limit outside 1 to 100. |
| 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?