Pagination
List endpoints return results one page at a time. From API version 3.7.0 you page with a cursor: pass the next_cursor from one page to get the next, until has_more is false.
Which endpoints are paginated
GET /agreementsGET /filesGET /themes
These return result_type: "paginated_list" with a pagination object next to data.
Cursor pagination
API clients on version 3.7.0 or later get this pagination object:
Cursor pagination
{
"version": "1.0",
"resource_type": "agreement",
"result_type": "paginated_list",
"pagination": {
"limit": 50,
"has_more": true,
"next_cursor": "2.d.mvlezzly.u9REw7ZiC5jq.cmvlezzlx00033lzeo4goe9sg"
},
"data": [ ... ]
}
limit: The number of items you asked for. If the page has items but fewer than you asked for, it's the number on the page.has_more: Whether there are more items after this page.next_cursor: The value to send ascursorto get the next page.nullwhen there are no more items.
There are no totals. If you need a count, page through the list.
Paging through a list
- Request the first page without
cursor. Setlimit(default 50),order_by, and any filters you need. - If
has_moreis true, send the same request again withcursorset tonext_cursor. - Repeat until
has_moreis false.
First page
GET /agreements?limit=100&status=pending
Next page
GET /agreements?limit=100&status=pending&cursor=2.d.mvlezzly.u9REw7ZiC5jq.cmvlezzlx00033lzeo4goe9sg
Rules for cursors
- Keep the query the same. A cursor belongs to the
order_byand filters it was created with. Sending it with a differentorder_byor different filters returns a 400. - Treat the cursor as opaque. Pass it back exactly as you got it. Don't build or edit one yourself; an invalid cursor returns a 400.
- Don't send
page. On version 3.7.0 and later, a request withpagereturns a 400.
Offset pagination on older clients
API clients older than 3.7.0 keep paging with page and get totals in the response:
Offset pagination
{
"pagination": {
"limit": 50,
"page": 1,
"total_results": 250,
"total_pages": 5
}
}
cursor is not available to these clients.
Requirements
Cursor pagination requires API client version 3.7.0. Upgrade your client from the API client settings on zigned.se by clicking "Upgrade".