Skip to navigation

Pagination and cursors

Walk every list without missing or repeating rows.

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.

StyleRequestResponseEnd of the list
Opaque cursorcursor, limitrows + nextCursornextCursor is null
Historybefore, takerows + nextCursor, hasMorehasMore is false
Offsetskip, takerows + total, skip, takeskip + take ≥ total
Event feedafter, limititems + nextCursor, hasMorehasMore is false; keep the cursor

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.

ExamplesParameters
Media albums, album contents, tags, asset usagecursor, limit
Marketplace listingscursor, limit
GIF and sticker searchcursor, limit (at most 30)
Comments on a postcursor, pageSize
A page
{
"items": [{ "albumId": "alb_123", "name": "Summer" }],
"nextCursor": "eyJ2IjoxLCJrIjoiYWxiXzEyMyJ9"
}

Conversation history

History pages run backwards from the newest message.

OperationParametersNext page
Read a conversation’s messagesbefore, take (at most 100)Pass nextCursor back as before while hasMore is true.
Media and links shared in a conversation, message searchbefore, takeThe same.
Messages after a known pointcursor, limitUse the answer’s newer as the next cursor.

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.

Examplestake
Conversations1–200, default 50
Mass messages1–200, default 50
Media assets1–100, default 48
Content1–100
Orders1–100, default 20
Order conversations1–200, default 50

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.

ItemRule
afterExclusive. Omit it to start at the oldest event still retained.
limit1–1000, default 100.
nextCursorAlways present. Store it after you have handled the page, and resume from it.
hasMoretrue while more events may follow; a page can hold fewer than limit events.
RetentionEvents are kept for 7 days. An older cursor is 410 CURSOR_EXPIRED: resync from the REST API, then read without after.
Foreign cursorA cursor that is malformed, altered or another application’s is 400 INVALID_CURSOR.

Read Event feed and consumer groups for checkpoints and multiple workers.

In the SDKs

Each official SDK walks the pages for you:

for await (const conversation of evva.conversations.iterate(creatorId)) {
console.log(conversation.id);
}
// One page at a time: evva.conversations.iterate(creatorId).pages()

The TypeScript and PHP paginators also stop, instead of looping, if the server ever repeated a cursor.

Next steps