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.

Hi @adam.housman I having usecase in which there are multiple organisation and each organisation could have a user signup with same mail using google o-auth2, facebook. Also there will be role assign to that user. In our case as user is same even if there are multiple entry in a organisation so sometime there could be change in role information. In this case if we able to filter base on email that it will become super awesome.

I have the same use case as @jason.kroll.

Hi @jason.kroll and @aaron.hardy,

We shipped this today: Auth0 Changelog

Happy coding,

Adam

1 Like