Skip to content
Get started
Overview

Pagination

Learn how to paginate through list endpoints in the Warp API using cursor-based pagination.

All list endpoints in the Warp API support cursor-based pagination. These endpoints share a common structure and accept the limit, afterId, and beforeId parameters.

List endpoints return a response with a data array and a hasMore boolean indicating whether additional results are available.

{
"hasMore": true,
"data": [
{ "id": "wrk_abc123", ... },
{ "id": "wrk_def456", ... }
]
}
FieldTypeDescription
hasMorebooleantrue if there are more results available beyond this page
dataarrayArray of resource objects
  • Optional, default is 25
  • Specifies the number of objects to return, ranging between 1 and 100
  • Optional, object ID
  • A cursor for forward pagination. afterId is an object ID that defines your place in the list. For example, if you make a list request and receive 25 objects ending with wrk_foo, your subsequent call can include afterId=wrk_foo to fetch the next page of the list.
  • Optional, object ID
  • A cursor for backward pagination. beforeId is an object ID that defines your place in the list. For example, if you make a list request and receive 25 objects starting with wrk_bar, your subsequent call can include beforeId=wrk_bar to fetch the previous page of the list.

Fetch the first page of workers:

Terminal window
curl https://api.warp.dev/v1/workers?limit=10 \
-H "x-api-key: wrp_company_your_api_key"

Response:

{
"hasMore": true,
"data": [
{ "id": "wrk_abc123", "name": "Alice Smith" },
{ "id": "wrk_def456", "name": "Bob Jones" },
...
{ "id": "wrk_xyz789", "name": "Carol White" }
]
}

Fetch the next page using afterId:

Terminal window
curl https://api.warp.dev/v1/workers?limit=10&afterId=wrk_xyz789 \
-H "x-api-key: wrp_company_your_api_key"