# Search users with roles

**URL:** <https://community.auth0.com/t/search-users-with-roles/45388>\
**Category:** Get Help\
**Created:** [June 27, 2020, 6:10pm UTC](https://community.auth0.com/t/search-users-with-roles/45388 "2020-06-27T18:10:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![auth015](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/auth015/32/12732_2.png) [@auth015](https://community.auth0.com/u/auth015)\
**Post date:** [June 27, 2020, 6:10pm UTC](https://community.auth0.com/t/search-users-with-roles/45388/1 "2020-06-27T18:10:05Z")

</div>

Using machine to machine api how do I search for my users with a certain role for example business. I am required to grab a list of such users.

**Here is a shape of my user:**  
user: { app\_metadata: roles: [‘business’] }

Ideally I want to pass a query to my auth0 backend api which would return a list of users with such role.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 29, 2020, 8:34pm UTC](https://community.auth0.com/t/search-users-with-roles/45388/3 "2020-06-29T20:34:58Z")

</div>

Hi @auth015,

Have you looked at this endpoint?

> **[Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Roles/get_role_user)**

It will work if you are using the authorization core.

Hope this helps,  
Dan

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 21, 2020, 3:48pm UTC](https://community.auth0.com/t/search-users-with-roles/45388/4 "2020-09-21T15:48:35Z")

</div>

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