
NivS.45786 (Customer) asked a question.
Hi team,
I am trying to extract via the API the administrators in Okta and their roles (e.g: Super Administrator / Read-only Administrator etc).
In the UI it's under Security -> Administrators -> Admins
I have used the API call:
GET /api/v1/users/{user_id}/roles
For each user in the database (not efficient but couldn't find a better way, if there is please let me know)
However, it seems like only with Super Administrator roles I am able to get the data back which is weird.
Why it isn't possible to get these results with other roles such as "Read-only administrator"?
When trying with different roles I am getting the error - "You do not have permission to perform the requested action"
Error code - E0000006
Error ID - oae69BNYwYzS4q
Could you please help me with this?
Thanks!

Hello @NivS.45786 (Customer) Thank you for reacting out to our Community!
Based on our doc https://developer.okta.com/docs/reference/api/roles/#response-example-25, that API seems to be the only one to list roles for admins.
The reason you can not use Read-Only administrator is because you can not get information of a higher admin, please also review admin permissions below:
https://help.okta.com/en-us/Content/Topics/Security/administrators-admin-comparison.htm#API%C2%A0toke
The Okta Community Catalysts Program is now live. Collect online badges when you participate in the Okta Help Center Questions community. Learn more here.
The October issue of the Okta Community is here and packed with tips on certification, how to earn badges, and new releases. Let us help you stay connected.
That's fair, but this end-point didn't also work when trying to collect information on my own user.
I get why the admin cannot collect information on Super Admins. But admins on other admins?
Read-only is one of the lowest admin in Okta and has very few permissions, being one of the low permission admins it can not read most of admins.