Get user information by email or user-id

Contents

Get user information with the user email or user ID as request parameter. This API can search multiple users by email or user ID.

Endpoint URL: {service.auth.url} received in EndpointFetching



Request Syntax


GET /v2/auth0/user



Request Headers

Parameter Description Required
Authorization Authorization token in the form "Bearer {token}"

Value of type: string
true


Request Query Parameters

Parameter Description Required
email Allows you to search for users using their email addresses.

Array of type: string
false
userId Allows you to search for users using their My Cloud Home user ID.

Array of type: string
false


200 Response

OK

Response Payload

Parameter Description Required
data The details of the user - an extensible Json object that contains email, user_metadata that includes first_name, last_name and lang, picture, user_id

Value of type: object
false
error Object of type: Error false


Example

Sample request to retrieve user details by providing email or ID.

Request


GET /authservice/v2/auth0/user?email=test%40email.com HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 25951a7e-ffae-4edb-abb2-5e57d4ffb759
Content-Type: application/json

Response


HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 602

{
  "error" : null,
  "data" : [ 
    {
      "email" : "test@email.com",
      "picture" : "https://s.gravatar.com/avatar/574cae0abbcdf7627c95d927e67e6989?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fte.png",
      "name" : "test@email.com",
      "user_id" : "USER_ID",
      "user_metadata" : {
        "first_name" : "FIRST_NAME",
        "last_name" : "LAST_NAME",
        "lang" : "en",
        "time_zone_name" : "America/Los_Angeles"
      }
    } 
  ]
}

Have question about this section?