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.

3 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.

2 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

2 Likes

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

1 Like