Get organization role's users

API endpoint to get all members associated with one role in the organization

It would be useful to have one API endpoint that returns all organization members that have a specific role, just like endpoint /api/v2/roles/{id}/users but in the context of the organization.

The use case is that we want to have a table with all organization members and their data and it would be very useful to have displayed user roles that we can get with one API request instead of sending one API request for one user.

Hi @vladimir.bulatovic,

Thanks for creating this feature request!

Hi we’re running into a similar issue with a similar use case for this particular endpoint/feature. I see that something similar has been brought up before.

I think possibly even adding a roles attribute to the /api/v2/organizations/{id}/members would be super helpful. The current work around is to request member roles for each member which isn’t scalable as member sizes begin to grow.

5 Likes

Plus 1 for this, ideally it would also be added as an attribute on /api/v2/users.

I’m not using organisations currently but my usecase is similar of wanting to display a table of users on a per connection basis with the user’s role as one of the table columns.

The current best workaround I’ve found is to first query for all roles with /api/v2/roles then call /api/v2/roles/{id}/user for each role since you can at least get 100 users per api call that way with pagination. This is awkward though as you then need to manually filter out the users which aren’t from the connection you’re interested in. It also makes it really easy to accidentally fall foul of the rate limiting on the management api.

5 Likes

We also have a need for this feature. We use the organizations features (a lot) and love it so far. However, we frequently find limitations that are covered by the normal APIs (/users, /roles, etc) but are not carried over with support to organizations.

If we weren’t using organizations then we could use the /roles/{id}/users endpoint to get a list of users in a particular role. But with organizations, we have to first call /organizations/:id/members then iterate over each member with an additional call to /organizations/{id}/members/{user_id}/roles (yikes).

It’d be really great to have this functionality carried over in to the realm of organization endpoints! Cheers

5 Likes

Thanks for the feedback @btp-john.strickler and welcome to the community, makes sense to me!

1 Like

I agree with all the aboves, roles should be passed as part of the user properties. Having to go fetch it individually is inconvenient.

2 Likes

Hi :slight_smile: Is there any update on this? We would also love to have this as its rather painful having to loop individually

1 Like

Hi, are there any updates on this? It is unrealistic for our application to loop over every user and really need this feature if we’re going to utilize auth0 and organizations.

Hey there!

We are reviewing those Feedback topics on a monthly basis and will be performing another round in a few days. Compared to other feature requests it wasn’t receiving enough votes that’s why we’ve been taking into account topics that received more votes. Will let you know once we have any communication on that front!

1 Like

Hi Konrad, thank you for the update. Looking forward to hearing more!

1 Like

Hi @konrad.sopala, is there any update regarding this feature request?

About to implement the same unfortunately. Have you run into rate limiting issues with this approach? Did you have to do any backoff/limit # of parallel requests?

Regularly hitting rate limiting due to missing roles in individual users. Had to build a cache, which is less than optimal.

Unless there’s an API change here, will be moving role management back into our own stack after moving it to Auth0 in the first place.

4 Likes

Just adding my +1, lacking this feature makes the entire concept of role management in Auth0 entirely unusable. An organization of any size needs to be able to list the roles that members have at some point. If the only way to do that is to iterate through the entire list of users and make a request, we’ll get ratelimited and take forever. It’s astonishing that this isn’t possible yet.

4 Likes

Any updates on this from the Auth0 team? This is a really must-have feature to avoid getting rate-limited…

This is definitely very much needed.

You should now be able to retrieve the member roles by using the “Get Members”-endpoint :slight_smile:

1 Like

7 posts were split to a new topic: Error when trying to Get Organizations Role’s Users

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