List files

⚠️
Preview — this feature is being built; the design below is the spec.
GET https://app.syntic.ai/v1/files

Return 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

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.

Query parameters

ParameterTypeDefaultDescription
purposestringOnly files with this purpose.
limitinteger201 to 100.
after_idstringReturn files after this id: pass the previous page’s last_id.
before_idstringReturn 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:

StatustypecodeWhen
400invalid_request_errorinvalid_purposeUnknown purpose filter.
400invalid_request_errorinvalid_parameterlimit outside 1 to 100.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?