GET a list of all user accounts

Hello , I have read about the limit of 200 users when using GET request to list users. We have around 9000 user accounts, how can i modify the below curl command to get me every account ?

curl -v -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: SSWS ${api_token}" "https://${domain}/api/v1/users?" > /tmp/okta_dump.txt

I did read about the Pagination but couldn’t understand how to use pagination in the above curl command .
As a workaround, i tried running this way, but it errors our saying “Request not valid”. I don’t know what is wrong with the syntax. Looks OK to me and i copied this from the Documentation.

curl -v -X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/users?filter=status+eq+\"ACTIVE\""

Can someone pls assist ?

Thanks a lot.

Here’s a basic guide about pagination that walks you through how it works: Pagination Overview | Okta Help Center

To summarize: make your GET to /api/v1/users to receive the first 200 users (this is the max we will return as per the API reference). In the response from Okta, you will receive a link header with rel="next". You will then make your next request to that URL to get the next 200 users. Continue to do so until you receive all your users (and there is no rel="next" coming back from Okta).

If you are a developer and are familiar with one of the languages we have a management SDK/library for, you can look to use these SDKs instead, as they are designed to handle the pagination for you. We offer MGMT SDKs for .NET, Golang, Java, Node, PHP, and Python.

1 Like

Thanks Andrea, can you pls also take a look or have your team respond to this Qn:
Okta Identity Add-On for Splunk not importing a Full list of all users - Questions - Okta Developer Forums

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.