Pagination

Paginating the records

API responses that return collections are paginated to improve performance and response size control. You can manage pagination using the query parameters described below.

Query Parameters

ParameterTypeDefaultMaxDescription
pageinteger1Specifies the page number to retrieve (1-based indexing)
page_sizeinteger10100Number of records returned per page

Default Behavior

  • Pagination is 1-based
  • If page is not provided, the first page is returned
  • If page_size is not provided, 10 records per page are returned
  • The maximum allowed value for page_size is 100

Example Request

curl -H 'Authorization: <Access-Token>' \
     --request GET 'https://api.timeero.app/api/public/users?page=2&page_size=3'

Pagination Response Structure

{
  "meta_data": {
    "pagination": {
      "current_page": 1,
      "first_page_url": "https://api.sandbox.timeero.com/api/public/users?page=1",
      "from": 1,
      "last_page": 2,
      "last_page_url": "https://api.sandbox.timeero.com/api/public/users?page=2",
      "next_page_url": "https://api.sandbox.timeero.com/api/public/users?page=2",
      "path": "https://api.sandbox.timeero.com/api/public/users",
      "per_page": 10,
      "prev_page_url": null,
      "to": 10,
      "total": 12,
      "options": true
    }
  }
}

Pagination Fields Explanation

FieldTypeDescription
current_pageintegerThe current page number being returned
first_page_urlstringURL to retrieve the first page
fromintegerThe starting record number on the current page
last_pageintegerThe total number of available pages
last_page_urlstringURL to retrieve the last page
next_page_urlstring | nullURL to retrieve the next page, or null if none
pathstringBase endpoint URL without pagination parameters
per_pageintegerNumber of records returned per page
prev_page_urlstring | nullURL to retrieve the previous page, or null if none
tointegerThe ending record number on the current page
totalintegerTotal number of records available
optionsbooleanIndicates pagination options are enabled

Usage Guidelines

  • Always use pagination for endpoints that return collections
  • Avoid setting page_size to the maximum unless necessary
  • Clients should gracefully handle empty responses for pages beyond available data