Pagination

To allow the API Query to be able to fetch very large requests, they are automatically split into "pages" of data returned. The default and maximum page size depend on the endpoint; see each endpoint's reference page.

APIs that support pagination, accept two optional query parameters:

Parameter NameDescriptionDefault Value
pagePage number of the total data to return (starting from 1)1
per_pageData entries to return per page100 (unless otherwise specified)

The query will return the data in the following format:

{
  "items": [],
  "next_page": null
}

Some endpoints return has_next_page instead of, or in addition to, next_page. Check the endpoint's reference page for the exact fields.

FieldDescription
itemsAn array of entries returned for this query
next_pageThe next page number to request, or null on the last page.
has_next_pageA value of true signifies there are more pages of data available, to retrieve more entries another query should be made with the pageparamter increased by 1.
total_countReturned by Get Incidents only: the number of matching entries across all pages.

Sample pseudo-code

page = 1
finished = false

while (!finished) {
  returned_data = query_api("url&page={page}")
  
  if (returned_data.next_page == null && !returned_data.has_next_page) {
    finished = true
  } else {
    page = page + 1
  }
  
  process_data(returned_data.items)
}

Errors

Passing invalid values to the pageor per_pagewill result in 422errors.