Pagination
Pagination
List endpoints are paginated by page (1-indexed) and limit.
Query parameters
| Parameter | Type | Default | Max | Notes |
|---|---|---|---|---|
page | integer | 1 | — | 1-indexed page number |
limit | integer | 50 | 100 | Items per page |
sort | string | varies | — | field:asc or field:desc per endpoint |
Reading the response
{
"data": [ … ],
"pagination": {
"total": 1247,
"page": 1,
"limit": 50,
"totalPages": 25,
"hasNext": true,
"hasPrev": false
}
}Iterating
let page = 1;
while (true) {
const res = await fetch(`/api/v1/partners?page=${page}&limit=100`, {
headers: { 'x-api-key': KEY },
});
const { data, pagination } = await res.json();
for (const partner of data) handle(partner);
if (!pagination.hasNext) break;
page++;
}Stable ordering
If you don't pass sort, ordering is stable but endpoint-specific (usually
createdAt:desc). For consistent paging across requests, always specify
sort explicitly — otherwise newly inserted rows can shift items and
cause skips or duplicates.
Hard cap
Asking for limit > 100 returns 400 VALIDATION_FAILED. If you need bulk
exports of large datasets, use the export endpoints (CSV) where they exist
or contact us.
Updated about 4 hours ago