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 On the agent session and message lists, which only have cursor mode, you can simply omit
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.)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.- the endpoint and your workspace,
sortByandsortOrder,- every filter on the request (for example
updatedAfter,directoryId,fileIds).
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
Leavecursor out and the response keeps its original shape: a named array, plus count and currentPage.
Reference
Cursor mode parameters
The agent lists take only
cursor and limit, with their own order and sizes:
Pagination object
Legacy mode parameters
Related
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.