Pagination
Lists answer with one page in data, and a nextCursor that points to the next one:
{
"data": [{ "id": "emp_LssEG8crOK3xrxCVx1nS6jy7", "fullName": "Ada Lovelace" }],
"nextCursor": "emp_LssEG8crOK3xrxCVx1nS6jy7"
}
To get the next page, repeat the request with cursor set to that value. nextCursor is null on the last page.
| Parameter | What it does |
|---|---|
limit | How many to return, from 1 to 100. The default is 50 |
cursor | Where to carry on from. Leave it out to start at the beginning |
Lists are ordered by ID, so a page doesn't shift if someone is renamed while you're reading. Treat the cursor as a value to pass back, and don't build anything on its format.
The reports that can name a lot of people page the same way: upcoming rewards, quiet employees and coverage gap employees. Their totals describe the whole report and repeat on every page.
Each page is worked out when you ask for it. A person or program that changes between requests can move a total, but it can't make the rows around it repeat or go missing.
The Read your data guide has a full example.