List endpoints use continuation token-based pagination to retrieve results across multiple requests.
- For the first request, do not provide a
continuationToken. - The response will include an
itemsarray and, if there are more results, acontinuationToken. - Pass the returned
continuationTokenin the next request to retrieve the subsequent page of results. - Continue requesting with the latest
continuationTokenuntil the response returnsnullforcontinuationToken, indicating there are no more results.
| Parameter | Type | Required | Description |
|---|---|---|---|
continuationToken | string | No | The token from the previous response. Omit for the first page. |
pageSize | int | No | The maximum number of items to return per page. Must be between 1 and 100. Defaults to 100. |
Some list endpoints support sorting via the sortBy parameter. The sortBy parameter is optional and accepts a list of sort options. Refer to each endpoint's documentation for the available sort fields.
List endpoints support filtering via the filters parameter. The available filter fields are endpoint-specific and some endpoints require that certain filters are set. Refer to each endpoint's documentation for the available filter criteria.
All list endpoints return a response in the following format:
{
"items": [
...
],
"continuationToken": "eyJza2lwIjo..."
}| Field | Type | Description |
|---|---|---|
items | array | The list of items for the current page. |
continuationToken | string? | A token to retrieve the next page, or null if this is the last page. |
The following example uses the List Employees endpoint to illustrate pagination.
For the first page, send a POST request without a continuationToken:
curl -X POST https://api.bright.hr/employees/v1/query \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"{
"items": [ ... ],
"continuationToken": "eyJza2lwIjo..."
}The presence of a continuationToken indicates there are more results.
To retrieve the next page, send the continuationToken in the request body:
curl -X POST https://api.bright.hr/employees/v1/query \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"continuationToken": "eyJza2lwIjo..."}'When there are no more results, continuationToken will be null:
{
"items": [ ... ],
"continuationToken": null
}