List endpoints return results a page at a time. Most support two modes, chosen by one parameter: send cursor and you get cursor mode; leave it out and you get legacy page/limit mode. Use cursor mode for anything that walks a whole result set — it stays correct while data changes and costs the same on page 500 as on page 1. Legacy mode is still fully supported. Existing integrations don’t need to change.

When to use it

Cursor mode has no total count — counting is what makes deep offset paging expensive. Drive your loop with hasMore.

How it works

Endpoints

cursor is also listed on GET /v1/file-type, GET /v1/schemas/file-type and GET /v1/files/{fileId}/values, because they share the same parameter set. Those endpoints don’t implement cursor mode: cursor is accepted and ignored, and you get a legacy response. Use page and limit there.

Cursor mode

1

Request the first page

Send cursor with an empty value. Its presence is what switches on cursor mode. (FILEAI_BASE_URL is https://api.orion.file.ai/prod/v1, or your regional host.)
On the agent session and message lists, which only have cursor mode, you can simply omit cursor for the first page.
2

Read the pagination object

Results come back in data, with a pagination object:
3

Follow nextCursor until hasMore is false

Pass nextCursor back as cursor, with the same filters and sort. When hasMore is false, nextCursor is null and you’re done.
Cursors are opaque, signed strings in unpadded base64url, so they are already safe to put in a URL. Don’t build, decode or edit them. A cursor only works with the request that produced it. It is bound to:
  • the endpoint and your workspace,
  • sortBy and sortOrder,
  • every filter on the request (for example updatedAfter, directoryId, fileIds).
Change any of these mid-walk, or send a cursor that has been altered, and you get 400 BAD_REQUEST (“Please restart pagination”). Start a new walk without a cursor.
Sorting by updatedAt is best-effort: a row updated during your walk can move past the point you’ve reached and appear again, or be skipped until your next walk. createdAt and _id give an exact walk.

Legacy mode

Leave cursor out and the response keeps its original shape: a named array, plus count and currentPage.
In legacy mode on GET /v1/files and GET /v1/schemas, results are only sorted when you send both sortBy and sortOrder. If either is missing, the order is unspecified and pages can overlap or skip rows. Always send both.

Reference

Cursor mode parameters

The agent lists take only cursor and limit, with their own order and sizes:

Pagination object

Legacy mode parameters

Incremental loading

Combine cursors with updatedAfter to sync changes.

Agent sessions

Cursor-only lists of sessions and messages.

Errors

What a 400 for a bad cursor looks like.

Authentication and regions

Base URLs and request conventions.