All list endpoints use cursor-based pagination. Cursors are opaque tokens — do not decode or construct them manually.
Parameters
| Parameter | Required | Default | Max | Description |
|---|---|---|---|---|
limit | No | 100 | 250 | Items to return per page |
after | No | — | — | Cursor for the next page (from paging.cursors.after) |
before | No | — | — | Cursor 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="
}
}
}| Field | Description |
|---|---|
paging.limit | Current page size |
paging.hasMore | true if more items exist after the current page |
paging.cursors.after | Pass as ?after= to get the next page. null when on the last page. |
paging.cursors.before | Pass 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=descNext 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.