# User Search with multiple user\_ids not working

**URL:** <https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192>\
**Category:** Get Help\
**Tags:** user-id, search, management-api\
**Created:** [June 22, 2017, 1:54am UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192 "2017-06-22T01:54:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmcardle](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lmcardle](https://community.auth0.com/u/lmcardle)\
**Post date:** [June 22, 2017, 1:54am UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192/1 "2017-06-22T01:54:00Z")

</div>

I’m trying to use the Auth0 management API to to query with multiple user\_ids, and receive an array of users back. However, it’s not working.

I’m following the docs here: [Management API Reference - Auth0 Docs](https://auth0.com/docs/api/management/v2#!/Users/get_users) and here: [Search for Users - Auth0 Docs](https://auth0.com/docs/api/management/v2/user-search)

This query works as expected, returning an array containing a single user: `https://auth-dev.mozilla.auth0.com/api/v2/users?q=user_id:"<user_id_1>"&search_engine=v1`

This query doesn’t, returning a ‘Something went wrong’ error: `https://auth-dev.mozilla.auth0.com/api/v2/users?q=user_id:("<user_id_1>" OR "<user_id_2>")&search_engine=v1`

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [June 22, 2017, 9:52am UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192/2 "2017-06-22T09:52:28Z")

</div>

I have successfully managed to make a call for multiple user\_id’s using search\_engine: v2. Please try using v2 to see if it works.

```
https://auth-dev.mozilla.auth0.com/api/v2/users?q=user_id:("<user_id_1>" OR "<user_id_2>")&search_engine=v2

```

---

<div class="post-metadata">

**Author:** ![lmcardle](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lmcardle](https://community.auth0.com/u/lmcardle)\
**Post date:** [June 22, 2017, 5:46pm UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192/3 "2017-06-22T17:46:26Z")

</div>

I now realise the second query in my original post was returning a ‘Something went wrong’ error because I wasn’t url encoding the q parameter. When I do I only get an empty array back.

If I try to use v2:

{“statusCode”:400,“error”:“Bad Request”,“message”:“The ‘q’ parameter is available only if you specify ‘search\_engine=v1’.”,“errorCode”:“invalid\_query\_string”}

---

<div class="post-metadata">

**Author:** ![gdestuynder](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gdestuynder](https://community.auth0.com/u/gdestuynder)\
**Post date:** [July 20, 2017, 12:14am UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192/4 "2017-07-20T00:14:05Z")

</div>

@prashant i suspect this is because this tenant is not the public cloud and does not support q= with v2 engine.

---

<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:54am UTC](https://community.auth0.com/t/user-search-with-multiple-user-ids-not-working/7192/5 "2018-03-02T05:54:51Z")

</div>


