To Get All the Roles from OKTA system with Postman API

Hi Team,

We are trying to retrieve all available roles along with users to whom those are assigned. I found that we need to do this by specifying ‘UserID’ in API request - {{url}}/api/v1/users/{{userId}}/roles by Using ‘Get’ method. Is there any way by which I can get all the users and roles assigned to them in single request instead of giving individual ‘UserID’?

Thanks in advance

Hi Prasad, The way you are doing this is the way that it currently has to be done. You will need to go through each user and request the /roles endpoint. I will pass this along to the rest of the team so we can discuss this, and look at how we can improve this based on what you were looking to do.

-Brian

1 Like

Hi Team,

Any update on this as about any changes in new approach to get the bulk user roles instead of individual user.

  • Prasad

Hi @Prasad. Unfortunately there is no public API for accessing the bulk roles.

There is an undocumented API call mentioned here that can satisfy your use case, however this behavior can change without notice.