Pagination
Iterate through large result sets with cursor-based and offset-based pagination
GETTING STARTED · SDK · PAGINATION
List endpoints return paginated results. The Clossir API uses two pagination styles depending on the endpoint.
Cursor-based pagination (primary)
Most list endpoints use cursor-based pagination. Pass cursor and limit as query
parameters; the response includes a nextCursor field for the next page.
cursor-pagination.ts
Iterating all pages
iterate-all.ts
Defaults and limits
The cursor is typically the created_at timestamp of the last item, but treat it as an
opaque token — don’t construct cursors manually.
Offset-based pagination
Some endpoints (notably ledger queries) use traditional offset-based pagination with a
total count in the response:
offset-pagination.ts
Iterating with offset
offset-iterate.ts
Which style does my endpoint use?
Check the endpoint’s request parameters:
- Has
cursor→ cursor-based (most endpoints) - Has
offset→ offset-based (ledger, some analytics)
The API Reference documents the pagination parameters for each endpoint.
Next steps
- API Reference — see pagination parameters per endpoint
- Async Operations — understand the 202 command pattern