Pagination
Cursor pages, and the four endpoints that have none.
Lists are cursor-paginated:
{
"data": [],
"meta": { "has_more": true, "next_cursor": "1287" }
}Pass next_cursor back as starting_after for the next page. Stop when
has_more is false.
curl "https://app.sendkuy.com/api/v1/contacts?limit=50&starting_after=1287" \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"limit defaults to 20 and is capped at 100.
With an SDK
autoPaginate() walks every page for you, fetching the next one only when the
loop reaches it:
const page = await sendkuy.contacts.list({ limit: 100 });
for await (const contact of page.autoPaginate()) {
console.log(contact.id);
}To go one page at a time, nextPage() returns the next page, or null after
the last. A PHP page can also be counted and looped over directly; that covers
the rows of that one page only.
The cursor is opaque
Its shape differs between endpoints and can change without notice. Treat it as a string you hand back, not as something to parse, compare or construct.
Four endpoints answer without meta
POST /messages, POST /messages/batch, POST /whatsapp/numbers/check and
GET /contact-attributes return { "data": [...] } with no meta at all.
They are lists, not pages — nothing was cut off, so there is nothing to page
through. Three of them return one row per element you sent; the fourth returns
every attribute you have defined.
Code that assumes meta exists on every array response will break on exactly
those four.