# Get list of users by role / attribute over API

**URL:** <https://forum.opensearch.org/t/get-list-of-users-by-role-attribute-over-api/334>\
**Category:** Security\
**Created:** [April 2, 2019, 8:20am UTC](https://forum.opensearch.org/t/get-list-of-users-by-role-attribute-over-api/334 "2019-04-02T08:20:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier](https://avatars.discourse-cdn.com/v4/letter/o/d2c977/32.png) [@Olivier](https://forum.opensearch.org/u/Olivier)\
**Post date:** [April 2, 2019, 8:20am UTC](https://forum.opensearch.org/t/get-list-of-users-by-role-attribute-over-api/334/1 "2019-04-02T08:20:58Z")

</div>

Hi,

I would like to know if there’s a way to retrieve users by role and attribute using the elastic API ? And how the best secured way to do this.

The idea behing is to save in the user attributes, for each user, the best way to send a warning if an alert is triggere. I don’t want to duplicate the users database (i use webhook for alerting).

best regards,  
Olivier

---

<div class="post-metadata">

**Author:** ![elifish](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/elifish/32/1451_2.png) [@elifish](https://forum.opensearch.org/u/elifish)\
**Post date:** [April 3, 2019, 12:15am UTC](https://forum.opensearch.org/t/get-list-of-users-by-role-attribute-over-api/334/2 "2019-04-03T00:15:35Z")

</div>

Hi @Olivier, would you be able to provide some more clarifying details regarding what you want to do? What is the scenario you want to accomplish and what steps are you trying? Thanks!
