> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quickblox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get User by Email

> Retrieve a user by email.

#### Recipes

<AccordionGroup>
  <Accordion title="Get user by email with API key">
    <Steps>
      <Step title="1. Use 'Authorization' header to pass API key">
        ```curl {2} theme={null}
        curl -X GET \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users/by_email.json?email=alex@gmail.com
        ```
      </Step>

      <Step title="2. As a result, the API returns a user with the specified email in the path params">
        ```curl theme={null}
        curl -X GET \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users/by_email.json?email=alex@gmail.com
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

#### Query Parameters

<ParamField query="email" type="string" required>User's email.</ParamField>

#### Headers

<ParamField header="QB-Token" type="string" required> A user session token. See [Authentication](/reference/authentication) page to learn more about the session token. </ParamField>
<ParamField header="Authorization" type="string" required default="ApiKey {your_api_key}"> API key from Dashboard. Expected format: `ApiKey {your_api_key}`. Must be used either QB-Token or Authorization.</ParamField>

#### Responses

<AccordionGroup>
  <Accordion title="200">
    A successful response

    <ResponseField name="user" type="object">
      <Expandable title="properties">
        <ResponseField name="id" type="integer" />

        <ResponseField name="full_name" type="string" />

        <ResponseField name="email" type="string" />

        <ResponseField name="login" type="string" />

        <ResponseField name="phone" type="string" />

        <ResponseField name="website" type="string" />

        <ResponseField name="created_at" type="string" />

        <ResponseField name="updated_at" type="string" />

        <ResponseField name="last_request_at" type="string" />

        <ResponseField name="external_user_id" type="integer" />

        <ResponseField name="facebook_id" type="string" />

        <ResponseField name="twitter_id" type="string" />

        <ResponseField name="blob_id" type="string" />

        <ResponseField name="custom_data" type="string" />

        <ResponseField name="age_over16" type="boolean" />

        <ResponseField name="allow_statistics_analysis" type="boolean" />

        <ResponseField name="allow_sales_activities" type="boolean" />

        <ResponseField name="parents_contacts" type="string" />

        <ResponseField name="user_tags" type="string" />
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="401">
    An error response

    <ResponseField name="errors" type="object">
      <Expandable title="properties">
        <ResponseField name="base" type="array of strings" />
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="403">
    An error response

    <ResponseField name="errors" type="object">
      <Expandable title="properties">
        <ResponseField name="base" type="array of strings" />
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="404">
    An error response

    <ResponseField name="code" type="string" />

    <ResponseField name="message" type="string" />
  </Accordion>
</AccordionGroup>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET \
  -H "QB-Token: bdbb2bd5abb81b1d7fe7be03db9305b46e012bba" \
  https://api.quickblox.com/users/by_email.json?email=alex@gmail.com
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "user": {
      "id": 96754523,
      "full_name": "Alex Miller",
      "email": "alex@gmail.com",
      "login": "Alex",
      "phone": "+3123555",
      "website": "https://mysite.com",
      "created_at": "2019-08-27T21:08:55Z",
      "updated_at": "2019-08-27T21:08:55Z",
      "last_request_at": null,
      "external_user_id": 126672,
      "facebook_id": "888766",
      "twitter_id": "982366",
      "blob_id": null,
      "custom_data": null,
      "age_over16": true,
      "allow_statistics_analysis": true,
      "allow_sales_activities": true,
      "parents_contacts": "",
      "user_tags": "android,web"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "errors": {
      "base": [
        "Required session does not exist"
      ]
    }
  }
  ```

  ```json 403 theme={null}
  {
    "errors": {
      "base": [
        "Users retrieving forbidden in admin panel, application settings. Setup it here https://admin.quickblox.com/apps/{app_id}/service/users/settings"
      ]
    }
  }
  ```

  ```json 404 theme={null}
  {
    "code": null,
    "message": "Couldn't find user"
  }
  ```
</ResponseExample>
