Search users in organization

Hi

Is there a way via the management api to search or filter members within an organization?

Currently I can only see a way to get all members of an organization but no way to search by say email or name (/api/v2/organizations/{id}/members)

So if I wanted to implement a search I currently would need to search all users (using /api/v2/users?q=email:jason*) and then individually check each user is a member of the current organization?

Or alternatively I could get all members of the org and then filter the response.

Is this correct or is there be a better way to do this?

Jason

Hi @jason.kroll - there is not a method to achieve this currently. Would you mind sharing a few details about what you’re looking to do with this? Depending on your use-case and how many members-per-organization you plan to have, it may be more convenient to do it the other way around - get all org members then match email in that list?

1 Like

Hi Adam

We have an app that will have multiple orgs and each orgs members should not be able to see each other.

If we have a search box, searching users, we don’t want users from outside the current org to be returned.

I’m not sure about the numbers of members per org, probably low at this stage, but just for efficiency I thought the ability to search the orgs members would be the correct way to go.

For the moment I will just have to get all members and filter the list on the backend.

Thanks.