Use the offset and limit query parameters to paginate through results.

Using Offset and Limit

  • offset: The number of items to skip before starting to collect the result set i.e page size.
  • limit: The number of items to return.

Example Request

To get the second page of subcontractors, assuming a page size of 25:
GET /subcontractors?offset=25&limit=25 HTTP/1.1
X-BuildPass-Api-Version: v1
Authorization: Bearer YOUR_ACCESS_TOKEN

Example Response Structure

The response will include a meta object with pagination details.
{
  "data": [
    {
      "id": "sub_clgbsb90b001qjy0f0eo1hspp",
      "createdAt": "2023-10-03T23:19:35.771Z",
      "updatedAt": "2023-10-03T23:19:35.771Z",
      "name": "Andrews Brick Laying",
      ...
    }
  ],
  "meta": {
    "totalCount": 100,
    "totalPages": 4,
    "offset": 25,
    "limit": 25
  }
}