Skip to main content

Choose a page size

Employee search uses one-based page numbers. Start at page: 1. These limits apply to employee search. Check the corresponding reference for group listing and other paginated operations.

Continue while hasMore is true

Search responses include pagination.page, pagination.pageSize, and pagination.hasMore. Keep your filters and sort consistent and increment page until hasMore is false. Empty matches and pages beyond the end return an empty list. This shell example uses curl and jq, with the environment variables from Making requests. It prints one employee object per line:
The loop stops on an HTTP error so you can inspect it. For a production job, add bounded retries and Retry-After handling. Coordinate pacing across concurrent workers that share credentials.

Include archived employees

The filter defaults to CURRENT. Change the loop’s filter to status: "FORMER" for archived employees or status: "ALL" for current and former employees. Set ALL on nested filters too if they should match archived employees.

Request totals only when needed

Add include: { "total": true } to a search body when you need the total number of matches:
This adds pagination.total. Otherwise, total is omitted and the extra count is skipped. You don’t need a total to iterate: use hasMore. For only a count, use Count matching employees. Send {} when you have no filters. Counts return { "total": number } and don’t take page fields.

Account for changes during a sync

Page pagination reads live data; it doesn’t create a snapshot. Employees added, archived, or edited during iteration can move between pages. Sorting by ID gives a consistent ordering for unchanged data, but doesn’t provide snapshot or cursor guarantees. Make your sync able to handle repeated IDs and reconcile changes across runs.