Overview
Several Chief API list endpoints use cursor-based pagination so you can walk large datasets without offset drift. Paginated responses include:
Use resource ids as cursors. The cursor id is excluded from the next page (the page starts strictly after or before that id).
Supported endpoints
Parameters
All cursor-paginated endpoints accept:integer
default:"25"
Maximum items per page. Minimum
1, maximum 100.string
Resource id from the previous response’s
last_id. Returns items strictly after this id. Omit on the first request. Mutually exclusive with before_id.string
Resource id to paginate backward from. Returns items strictly before this id. Mutually exclusive with
after_id.Response format
Forward pagination
Passlast_id from the current page as after_id on the next request when has_more is true:
Backward pagination
Passfirst_id from the current page as before_id to walk toward older items:
Best practices
- Check
has_morebefore requesting another page. - Choose a
limitthat fits your use case (smaller for UI lists, larger for batch exports). - Do not send
after_idandbefore_idin the same request.
FAQ
Is the cursor item itself included in the next page?
Is the cursor item itself included in the next page?
No. The page starts strictly after
after_id, or strictly before before_id. The cursor id is excluded.What is the maximum page size?
What is the maximum page size?
limit accepts 1 to 100 and defaults to 25. A value outside that range returns HTTP 400.What happens if I send after_id and before_id together?
What happens if I send after_id and before_id together?
They are mutually exclusive. Sending both returns HTTP
400.Why does listing labels always report has_more as false?
Why does listing labels always report has_more as false?
GET /v1/labels returns the full list in v1 rather than paging, so there is never another page to fetch.What order are chats returned in?
What order are chats returned in?
Newest first. Assets use the same list envelope.
Related
- Introduction
- Errors
- API reference → Chats —
GET /v1/chats - API reference → Assets —
GET /v1/assets