API Pagination
Overview
List endpoints use cursor-based pagination. You navigate through results using the after and before parameters with resource IDs as cursors.
Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results to return (1–100, default: 20) |
after | string | Return results after this resource ID |
before | string | Return results before this resource ID |
order | string | Sort order: asc or desc (default: desc) |
Basic usage
Fetch the first page of results:
Fetch the next page using the last ID from the previous response:
Response headers
List responses include the following pagination headers:
Link
Navigation URLs following RFC 5988:
Has-More
A boolean indicating whether there are more results beyond the current page:
Limit
The limit that was applied to the current request:
Example
Filtering
Many list endpoints support additional query parameters for filtering:
| Endpoint | Filters |
|---|---|
GET /tasks | status, kind, run_id, created_by |
GET /runs | status |
GET /events | kind |