Pagination and cursors
List operations return one page at a time. There are four paging styles; each operation’s page in the API reference shows which parameters it takes and their bounds.
Cursors are opaque. Pass them back exactly as you received them, never build or edit one, and never use a cursor
with an operation other than the one that issued it. The conversation inbox and the event feed refuse an altered
cursor with 400 rather than read it as “page one”.
Opaque cursor
Send limit for the page size and, from the second page on, cursor set to the previous page’s nextCursor.
Stop when nextCursor is null.
Conversation history
History pages run backwards from the newest message.
To catch up forward from where you stopped, pass a history page’s nextCursor as cursor to the
“messages after” operation.
Offset pages
Some lists page by position: skip rows, then take rows. The answer carries total.
For the conversation inbox sorted by recent activity, prefer the cursor over skip: pass the answer’s nextCursor as
cursor (skip is ignored with it). No row is skipped or repeated when the inbox reorders between pages.
Event feed
GET /partner/v1/events is different: its cursor is a position in a durable,
ordered log of events, not a page of a list.
Read Event feed and consumer groups for checkpoints and multiple workers.
In the SDKs
Each official SDK walks the pages for you:
The TypeScript and PHP paginators also stop, instead of looping, if the server ever repeated a cursor.
