Auth0 Home Blog Docs

Get userinfo multiple users from a single request

userinfo
users

#1

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


#2

In my opinion, this endpoint lets you get the list of all the users.
More information can be found - https://auth0.com/docs/api/management/v2#!/Users/get_users

Hope this helps!


#3

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"

#4

Thanks, this worked!


#5

Thanks, this worked!


#6