List Users API {{url}}/api/v1/users?limit=25 Skip to main content
https://support.okta.com/help/answers?id=9062a000000xzocqaw&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Daniel WardDaniel Ward 

List Users API {{url}}/api/v1/users?limit=25

I am testing list users. It works fine in Postman and I can see the results. I try the exact same curl from PHP and I get thrown are error message which is ErrorCode":"E0000011","errorSummary":"Invalid token provided", I am using the same apikey in both and I am not sure why it would throw an error. I have clear trusted the domain using CORS etc.
Marc JohnstonMarc Johnston (Okta, Inc.)
Hi Daniel,

From the ErrorCode E0000011there was an Invalid token provided 401. The error codes are listed in this URL below:
https://developer.okta.com/reference/error_codes/

Here is a curl I have run from the command line recently to return users. You will also need to replace the subdomain to match your Okta org and update the xxxxxtokenxxxxxxxx with your token

curl -v -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: SSWS xxxxxtokenxxxxxxxx" 'https://subdomain.okta.com/api/v1/users?limit=10'