Get role ID from rest API Skip to main content
https://support.okta.com/help/answers?id=9060z000000jjfbqas&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:
Lin ZhangLin Zhang 

Get role ID from rest API

I am working on an integration project with okta via okta rest APIs. One use case needs to get ID for role type “APP_ADMIN”. I don’t find official API for this. (I think a simple API listing all roles should do it.)  Is there solution for this?

PS:
I see people talking about unofficial] or undocumented APIs. Also, will that ID will be consistent so that I can put it as configuration.

Thanks for advice!
Paul StinigutaPaul Stiniguta (Okta, Inc.)
Hello Lin,

At this time there is no API call that will provide the role ID. In order to get it you can use the API call /api/v1/users/${userId}/roles and using an App Admin user ID  to get the role ID for App Admin.
For Admin Roles API you can use this documentation.
https://developer.okta.com/docs/api/resources/roles?_ga=2.91157401.2076886823.1524581778-892821130.1524581577#administrator-roles-api
If you have any other question or require further assistance on this issue, don't hesitate to open a ticket with Support.

Kind Regards,

Paul Stiniguta
Technical Support Engineer
Okta Global Customer Care
 
Dylann FezeuDylann Fezeu (Customer First Programs)
Hello Lin,

Thanks for posting your inquiry in Okta Community Portal.

If you receive a great answer to your question(s), please help readers find it by marking it the best answer. Hover over the answer and click "Best Answer." 

Thank you,

Dylann Fezeu
Okta Help Center Team