Hey, in the end I managed via discussing with someone from support. I'll share here their feedbakc which helped!
For a full user directory, you'll want to paginate through /user instead of pulling everyone in one call. The endpoint supports:
pageSize keep at 100 since that's working reliably for you page page number, starting from 1
GET /user?pageSize=100&page=1
GET /user?pageSize=100&page=2
GET /user?pageSize=100&page=3
...
To know when to stop: the response includes a statistics object (which you already filter out in your Jinja template) that contains the total user count. Use it to calculate total pages, or just loop until a page returns an empty list / fewer than pageSize results.
Recommendations:
- Stick with
pageSize=100, known to work without 422 or timeout issues. - Add a small delay (200–500ms) between calls to avoid rate limiting.
- Schedule the directory rebuild (e.g., daily) rather than running on demand.
- Handle per-page failures with retries on the failed page rather than restarting the whole loop.
- For incremental syncs (after the initial load), the
/user endpoint supports filters like createdAfter / updatedAfter useful for syncing only new/changed users.
Full API reference: https://api2-eu-west-1.insided.com/docs/