Skip to main content
GET
Get all files
Get all files in the organization and workspace bound to your API key.

Query Parameters

This endpoint supports both pagination modes. Send the cursor parameter (empty value for the first page) to use cursor pagination; omit it entirely to keep the legacy page/limit response shape. See Pagination for the full comparison.

Filtering by directory

directoryId returns only files directly linked to that directory. Files in nested descendants are not included — pass the sub-directory id directly to fetch its files.
Examples use the default base URL, https://api.orion.file.ai/prod/v1. If your workspace is on an instance-specific host, swap the hostname and change nothing else — see Switching between instances.

Incremental sync

updatedAfter and createdAfter let batch processes fetch only what changed since the last run. See Incremental Data Loading for the full Change Data Capture pattern.

Pagination

See Pagination for the full comparison.

Errors

A 422 is returned when updatedAfter or createdAfter is not a valid ISO 8601 timestamp. See Error responses.

Authorizations

x-api-key
string
header
required

API key for authentication

Query Parameters

fileIds
string

File Ids

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

updatedAfter
string

Filter files updated on or after this timestamp (ISO 8601 format)

Example:

"2025-01-01T00:00:00.000Z"

createdAfter
string

Filter files created on or after this timestamp (ISO 8601 format)

Example:

"2025-01-01T00:00:00.000Z"

directoryId
string

Filter files that belong to the given directory (or sub-directory) id. Only files directly linked to this directory are returned; descendants are not included.

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

page
number
default:1

Page number

Example:

1

limit
number
default:100

Number of items per page

Example:

100

sortBy
string
default:createdAt

Field to sort by

Example:

"createdAt"

sortOrder
enum<string>
default:ASC

Sort direction

Available options:
ASC,
DESC
Example:

"ASC"

cursor
string

Opaque pagination cursor. Provide the parameter (empty value for the first page) to switch to cursor pagination: the response becomes { data, pagination: { limit, nextCursor, hasMore } } with default limit 50 (max 100). Omit it entirely for legacy page/limit pagination. In cursor mode sortBy must be one of createdAt, updatedAt, _id, and cursors are bound to the sortBy/sortOrder they were minted with.

Response

The list of files is found. Offset mode (default) returns {files, count, currentPage}; cursor mode (when the cursor query parameter is present) returns {data, pagination}.

files
object[]
required
count
number
required

Total number of matching files

currentPage
number
required