Pagination
How to page through large result sets in the ENLYZE API.
List endpoints in the ENLYZE API return results one page at a time. Instead of returning every record at once, the API returns a single page along with a cursor you use to fetch the next page. With limit you set how many records a page holds at most.
How pagination works
The ENLYZE API uses cursor-based pagination. The flow is always the same:
Call a list endpoint without a
cursorto get the first page.Read the
metadata.next_cursorvalue from the response.Call the same endpoint again, passing that value as the
cursorparameter, to get the next page.Repeat steps 2 and 3 until
metadata.next_cursorisnull. At that point there is no more data.
Keep all other parameters (such as filters and limit) unchanged across follow-up requests. Otherwise the cursor is no longer valid.
Response structure
Every paginated response has the same structure:
data
Array
The records on the current page.
metadata.next_cursor
String or null
The continuation point for the next page. null when there is no more data.
On the request side, you control pagination with two parameters:
cursor
Query
The starting point of the page to fetch. Pass the metadata.next_cursor value from the previous response. Without a cursor, you get the first page.
limit
Query
The maximum number of records per page. Without a limit, a page holds up to 1000 records. 1000 is also the maximum.
Control the page size with limit
A limit below the default shrinks the page. A larger one is not possible, because the default is also the maximum.
limit combines with cursor and with all filters. If the result set holds more records than limit allows, the response still carries a next_cursor for the next page. On sorted endpoints, limit follows that order: limit=1 returns the first record of the sort.
A limit that is not an integer, is below 1 or above the maximum is rejected with status code 422 (see Errors).
Example
Fetch the first page:
Response:
Fetch the next page by passing next_cursor as cursor:
To fetch a single record, for example to check whether there are any production runs at all, set limit=1:
On the last page, next_cursor is null:
Last updated