Skip to main content

Pagination and Sorting

Query parameters

The API client can specify some pagination parameters in the query string:

Parameter nameDescription
pageThe current page index. Starts from 0.
sizeThe number of objects per page.
sortThis parameter is used to sort the results by a property (or properties). The format is sort=[property1(asc/desc)]. For example to sort contacts by the first name the API client sends ?sort=first_name. Multiple properties are sent as separate parameters: ?sort=first_name&sort=last_name. Each property can have its own sorting direction: ?sort=first_name,asc&sort=last_name,desc. The sorting direction is asc by default.

Response

A paginated response example:

{
"status": "success",
"data": {
"objects": [
...
],
"pagination": {
"total_pages": 1,
"total_objects": 2,
"limit": 20,
"page": 0
}
}
}

Each parameter explained:

Parameter nameDescription
total_pagesThe number of total pages in the response.
total_objectsThe number of total objects in the response.
limitThe number of objects per page. Defaults to 20.
pageThe current page index; starts from 0.