Pagination▾
Pagination
Cursor pagination on every list endpoint.
List endpoints return a cursor-paginated envelope. Cursors are opaque — do not construct or decode them.
List envelope
{
"object": "list",
"data": [ { "object": "message", "id": "msg_01JZ…" } ],
"has_more": true,
"next_cursor": "eyJpZCI6Im1zZ18wMUpaIn0"
}Query parameters
limitintegerdefault 25Page size, 1–100.
cursorstringThe next_cursor from the previous page.
orderenumdefault descSort direction on created_at.
ascdesc
Node
let cursor: string | null = null;
do {
const url = new URL("https://api.sendport.tech/v1/messages");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers: { Authorization: `Bearer ${key}` } });
const page = await res.json();
for (const message of page.data) handle(message);
cursor = page.next_cursor;
} while (cursor);