To ensure efficient handling of large datasets, our Public API supports pagination. This allows you to retrieve data in manageable chunks, improving performance and reducing the risk of timeouts or excessive memory usage.
When an API response contains a large amount of data, the results are split across multiple pages. Each page contains a subset of the total results, and you can navigate between pages using query parameters.
Forms of pagination
Admina supports two kind of pagination: page and cursor based. Each endpoint in our API Reference refers to the one being used (if any).
Page based
Parameters
The following query parameters are used to control pagination:
page
: Specifies which page of results to retrieve, starting at 1 with a default value of 1. If the page number exceeds the total number of available pages, it will default to the last page.limit
: Specifies the number of items to return per page (e.g., 20, 50, 100). The default limit is 50, although this may vary depending on the endpoint. You can adjust this limit as needed, but note that most endpoints have a maximum limit of 200.sortField
: Optionally sort the results based on this field. For a list of available fields, please refer to the documentation for each endpoint.order
: Sort the results in ascending (ASC
) or descending (DESC
) order. Default is ascending (ASC
).
For example, to request the second page of results with 100 items per page, sorted in descending order by the field email
:
/example?page=2&limit=100&sortField=email&order=DESC
Response
A paginated response will include metadata
to help you navigate through the results:
prevPage
: The previous page. This will benull
if there is no previous page, such as when you are on the first page.nextPage
: The next page. This will benull
if there is no next page, such as when you are on the last page.
Example response
{
"data": [
// ...
],
"metadata": {
"prevPage": 1,
"nextPage": null
}
}
Cursor based
Parameters
The following query parameters are used to control pagination:
cursor
:The pagination token you received from the previous query to retrieve the next page of results. If omitted, the first page will be returned.limit
: Specifies the number of items to return per page (e.g., 20, 50, 100). The default limit is 50, although this may vary depending on the endpoint. You can adjust this limit as needed, but note that most endpoints have a maximum limit of 200.sortBy
: Optionally sort the results based on this field. For a list of available fields, please refer to the documentation for each endpoint.sortOrder
: Sort the results in ascending (ASC
) or descending (DESC
) order. Default is ascending (ASC
).
For example, to request the page with the given cursor
and the next 100 items, sorted in descending order by the field accountCount
:
/example?limit=100&cursor=aaabbbccc&sortBy=accountCount&sortOrder=DESC
Do not change
limit
,sortBy
, orsortOrder
after receiving acursor
token.If you have already started the pagination process and want to change any of these three properties, please restart the pagination (by omitting the
cursor
). Otherwise, the results may be invalid or lead to an error.
Response
A paginated response will include meta
to help you navigate through the results:
nextCursor
:cursor
for the next page. This will benull
if there is no next page, such as when you are on the last page.
Example response
{
"data": [
// ...
],
"meta": {
"nextCursor": "aaabbbccc"
}
}