Get userinfo multiple users from a single request

How do i get userinfo for multiple users from a single request, given the userid’s

Endpoint: api/v2/users

Works:

payload = {
        'include_totals': "true",
        'include_fields': "true",
        'fields' : 'email,username,user_id',
        'q': 'user_id:("%userid")' % userid
    }

Doesn’t work:

payload = {
        'include_totals': "true",
        'include_fields': "true",
        'fields' : 'email,username,user_id',
        'q': 'user_id:(auth0|59ba2fxxxxxxxx OR auth0|5765xxxxxxxxxxxxx)'
}

Note: Tried a combination of quotes around userid’s

In my opinion, this endpoint lets you get the list of all the users.
More information can be found - Auth0 Management API v2

Hope this helps!

Just tried the following request which worked as expected:

https://{your_domain}.auth0.com/api/v2/users?q=user_id%3A%22auth0%7C5a338510e8r986433ef3a5b7%22%20OR%20user_id%3A%22auth0%7C5a33850fbv901b79t9a7becd%22&fields=email,username,user_id&search_engine=v2&include_totals=true&include_fields=true

For readability here is the query before encoding:

user_id:"auth0|5a338510e8r986433ef3a5b7" OR user_id:"auth0|5a33850fbv901b79t9a7becd"

Thanks, this worked!

Thanks, this worked!