Pagination

All list endpoints use cursor-based pagination. Cursors are opaque tokens — do not decode or construct them manually.

Parameters

ParameterRequiredDefaultMaxDescription
limitNo100250Items to return per page
afterNoCursor for the next page (from paging.cursors.after)
beforeNoCursor for the previous page (from paging.cursors.before)

Do not use after and before simultaneously.

Response format

Every list response includes a paging object:

{
  "segments": [...],
  "paging": {
    "limit": 50,
    "hasMore": true,
    "cursors": {
      "before": "eyJpZCI6ImNhbXAtMTIzIn0=",
      "after": "eyJpZCI6ImNhbXAtMTI0In0="
    }
  }
}
FieldDescription
paging.limitCurrent page size
paging.hasMoretrue if more items exist after the current page
paging.cursors.afterPass as ?after= to get the next page. null when on the last page.
paging.cursors.beforePass as ?before= to get the previous page. null when on the first page.

Iterating pages

First page — include filters and sort as usual:

GET /api/segments?limit=50&sort=createdAt&direction=desc

Next page — pass only the cursor (filters and sort are encoded inside it):

GET /api/segments?after=eyJpZCI6ImNhbXAtMTI0In0=

Providing the same filters alongside the cursor is also valid. Changing filters mid-pagination returns 400 Bad Request.

Stop iterating when paging.hasMore is false or paging.cursors.after is null.