Pagination modes
Cursor-based pagination
Cursor-based pagination uses theafter parameter, which holds the ID of the last item from the previous page. This approach is more stable for datasets that change between requests because it avoids the duplicates and skips that can occur with page numbers.
To use cursor-based pagination:
- Make an initial request without the
afterparameter. - Extract the last item’s ID from the response.
- Pass that ID as the
afterquery parameter in the next request.
Page-based pagination
Page-based pagination uses thepage query parameter to request a specific page number. This is suitable for smaller or more stable datasets.
Page size limit
You can request up to 5,000 items per page using theitems query parameter. Requests that exceed this limit will be capped to 5,000.
Cursor-based request example
after=abc123 tells the API to return the next set of results starting after the patient with ID abc123, and items=1000 limits the response to 1,000 records.
Cursor-based pagination is recommended for large datasets because page numbers can shift if records are added or removed between requests.

