Pagination
Cursor-based paging across list endpoints
List endpoints in the CAIL Health API use cursor pagination. Cursors are opaque, stable across inserts, and safe to pass back unchanged.
Request
Response
Properties
- Stable. Cursors encode a position in the sort, not an offset. Inserts during paging do not cause items to be skipped or duplicated.
- Opaque. Callers must not parse, decode, or modify cursors. Cursor format is not part of the public contract and may change.
- Bounded. A cursor is only valid for the endpoint and query that produced it. Reusing a cursor across endpoints or after changing query parameters produces undefined behavior.
Iterating to the end
A typical client loop:
- Request the first page with
limitset to the page size you want. - Render
items. - If
nextCursoris present, request the next page withcursor=<nextCursor>. Otherwise, stop.