# Cursor-based pagination is the only reliable method at scale
gc users list --autopaginate --output json > all_users.json
# Or via API with cursor
curl -s "https://api.mypurecloud.com/api/v2/users?pageSize=100&cursor=${NEXT_CURSOR}" \
-H "Authorization: Bearer ${TOKEN}"
Do NOT use pageNumber. It degrades past page 50. Cursor is O(1) per page.
Think of the difference like this:
Page numbers are like flipping through a phone book - to get to page 500, you have to count through all 499 pages before it. The further you go, the slower it gets.
Cursors are like using a bookmark. No matter how deep into the book you are, the system jumps directly to your bookmark. It is always fast, regardless of how many users you have.
At the Edge appliance level, user pagination queries can put unexpected load on the local cache.
If you are running a script that paginates through 10,000 users from a server co-located with the Edge, the Edge’s local user cache may not have all users loaded. Each page request triggers a cache miss, which forces the Edge to query the cloud API, adding latency to every page.
For WFM data extraction, cursor-based pagination is essential.
When I pull the full user roster to feed into my forecasting model, page-number pagination at 10,000 users takes 45 minutes because each page gets progressively slower. Switching to cursor-based pagination completed the same extraction in 8 minutes with consistent 200ms response times per page.
I was using page numbers and my script kept timing out!
# My old code that was super slow
for page in range(1, 500):
users = api.get_users(page_number=page, page_size=25)
# This got slower and slower...
I switched to the cursor approach and it works great now. But sorry for the basic question - where do I find the cursor value in the API response? Is it in the headers or the body?