Pagination
Truto's API uses cursor-based pagination for all list endpoints.
Understanding the Response
Each call to a list endpoint returns an object containing two main attributes:
result: This attribute contains the list of resources returned by the current request.next_cursor: This attribute is a cursor that points to the start of the next page of results. Ifnext_cursoris null, then there are no more pages to retrieve.
Unified and Proxy API list calls can also carry:
prev_cursor: a cursor to the previous page, when the provider supports paging backwards.result_count: the number of records inresult.is_partial_response:truewhen the integration's list call returns records with only some of their fields, so fetching a record by ID can return more (Unified APIs only).
Admin API lists also return limit, the page size they used.
Using the Cursors
To fetch the next page, send the next_cursor value from the previous response as a query parameter, for example ?next_cursor=abc123.
Send the same filters, sort_by and limit with every request that carries next_cursor. On Admin API lists the cursor holds only a position, so next_cursor alone pages through every record. A page can hold fewer records than limit, even none, and still have a next_cursor, so stop only when next_cursor is null.
Limiting the Results
You can limit the number of records returned in a single request by using the limit query parameter. The limit parameter defines the maximum number of records to return. For example, ?limit=10 will return up to 10 records from the list. On Unified and Proxy APIs, limit is capped at the largest page size the integration allows — 100 unless the integration sets a different maximum — so a larger value returns at most that many records.
Without limit, an Admin API list returns up to 1,000 or 5,000 records depending on the endpoint, and a larger value is capped there. Set limit to page in smaller chunks.
Example
Here's an example of a response from a list call:
{
"result": [
{ "id": 1, "name": "Resource 1" },
{ "id": 2, "name": "Resource 2" }
],
"next_cursor": "abc123"
}In this example, result is an array of resources, and next_cursor is the cursor you would use to fetch the next page of results.