# API User metadata search, am I doing something wrong? -- GET /users

**URL:** <https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125>\
**Category:** Get Help\
**Tags:** api-search\
**Created:** [September 8, 2017, 1:14am UTC](https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125 "2017-09-08T01:14:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelwjoyner](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@michaelwjoyner](https://community.auth0.com/u/michaelwjoyner)\
**Post date:** [September 8, 2017, 1:14am UTC](https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125/1 "2017-09-08T01:14:08Z")

</div>

Is this also affected by the new ES clusters?

This is what I am using to get all users by “app\_id” :

```
https://{{auth0_domain}}/api/v2/users?q=user.app_metadata.app_id:dd

```

This is the POST to create users:

```
{
  "connection": "email",
  "email": "jill@jill.com",
  "user_metadata": {"role":"admin"},
  "email_verified": true,
  "app_metadata": {
  	"app_id" :"dd",
  	"license":"dcfff73c75887787531757c8ca986e47",
  	"tracker":"2"
  }
}

```

---

<div class="post-metadata">

**Author:** ![prakharkumar79](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prakharkumar79/32/7042_2.png) [@prakharkumar79](https://community.auth0.com/u/prakharkumar79)\
**Post date:** [September 8, 2017, 12:43pm UTC](https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125/2 "2017-09-08T12:43:26Z")

</div>

Yes, there were few minor problems in your query string. Here is the correct one 🙂

```
https://{{auth0_domain}}/api/v2/users?q=app_metadata.app_id:"dd"

```

More details around user search are outlined [here](https://auth0.com/docs/api/management/v2/user-search).

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 8, 2017, 3:36pm UTC](https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125/3 "2017-09-08T15:36:26Z")

</div>

In relation to the syntax and as another answer already pointed out I would expect it to be `q=app_metadata.property` instead of `q=user.app_metadata.property`, but this is only based on my own expectation and what I used in the past.

In addition **and probably the most important part** is that for some tenant accounts the ability to search by custom properties within `app_metadata` or `user_metadata` is restricted. More information about the restrictions is available as part of the status page [incident](https://status.auth0.com/incidents/71nlbr16j7ng) associated with the user search issue; the note has more details about which accounts may experience these restrictions and also has an email address you can reach out to if the restrictions caused issues in your application.

---

<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:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/api-user-metadata-search-am-i-doing-something-wrong-get-users/8125/4 "2018-03-02T05:56:23Z")

</div>


