Skip to content

Pagination

List endpoints return one page at a time:

{ "data": [ { "id": "ct_01J9Z8X7W6V5T4S3R2Q1P0N9M8" } ], "nextCursor": "eyJQSyI6..." }

nextCursor is null on the last page. Cursors are opaque: pass them back exactly as you got them, with the same filters.

Set the page size with limit, from 1 to 500 (default 100):

Terminal window
curl "$BASE/contacts?status=subscribed&limit=2" -H "Authorization: Bearer $KEY"

Then ask for the next page with the cursor you got:

Terminal window
curl "$BASE/contacts?status=subscribed&limit=2&cursor=<nextCursor>" -H "Authorization: Bearer $KEY"

Repeat until nextCursor is null. A page can hold fewer items than limit even when more pages follow, so stop on null, not on a short page.

Check it worked: the second page holds different contacts from the first.

  • GET /contacts
  • GET /segments
  • GET /templates
  • GET /templates/{id}/versions
  • GET /campaigns
  • GET /campaigns/{id}/recipients
  • GET /imports
  • GET /exports
  • GET /keys

An invalid cursor gives 422 validation_failed.

To get everything in one file instead, use an export.