Skip to content

Select theme

Pagination Guide

Many endpoints in Civillo support pagination, allowing you to retrieve results in smaller, manageable chunks.

Use the following query parameters to control pagination:

Parameter Type Description
pageSize Integer The number of items to return per page. Default is 50.
pageNumber Integer The page number to retrieve. Starts from 1.

To retrieve the first 10 items:

GET /api/items?pageSize=10&pageNumber=1

To retrieve the next 10 items (items 11-20):

GET /api/items?pageSize=10&pageNumber=2
{
"pageNumber": 1,
"pageSize": 50,
"totalCount": 100,
"totalPages": 2,
"items": [
{
"id": "1",
"name": "Example Item 1"
},
{
"id": "2",
"name": "Example Item 2"
}
// ... more items ...
]
}
  • If pageSize is not specified, the API defaults to a standard size (e.g., 50 items per page).
  • If pageNumber is not specified, it defaults to the first page (pageNumber=1).
  • totalCount represents the total number of items available across all pages.
  • totalPages is calculated based on totalCount and pageSize.
  • Use pageSize and pageNumber together to paginate through large datasets.
  • Always check the response for pagination metadata (totalCount, totalPages) to help guide navigation.
  • To fetch all results, loop through pages incrementally until pageNumber exceeds totalPages.