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

# Get UserInfo

> Get claims about the authenticated end-user, using an Access Token.

Get claims about the authenticated end-user, using an [Access Token](../exchange-authorization-code). Claims that do not exist will be omitted. This endpoint uses your [Custom Domain](/connected-apps/resources/custom-domains).

The contents of the response depend on the scopes granted to the client:

* All responses will always contain the sub claim.
* If the profile scope is granted, the name, `given_name`, `family_name`, `profile_picture`, and `locale` claims will be returned.
* If the email scope is granted, the email and `email_verified` claims will be returned.
* If the phone scope is granted, the `phone_number` and `phone_number_verified` claims will be returned.

You can call this endpoint via both `GET` and `POST`.

This endpoint implements the [OpenID Connect Core 1.0 UserInfo Endpoint](https://openid.net/specs/openid-connect-core-1%5F0.html#UserInfo).

<Info>
  We recommend using the [Custom Domain](/connected-apps/resources/custom-domains) whenever possible. For backwards compatibility reasons, this endpoint is also available at [https://test.stytch.com/v1/public/\$\{projectId}/oauth2/userinfo](https://test.stytch.com/v1/public/\$\{projectId}/oauth2/userinfo).
</Info>

## Response

<ResponseField name="sub" type="string">
  The subject of the token. This is a unique identifier for the user.
</ResponseField>

<ResponseField name="phone_number" type="string">
  The end-user's phone number. This claim is only returned when the client is granted the phone scope.
</ResponseField>

<ResponseField name="phone_number_verified" type="boolean">
  Indicates whether the end-user's phone number has been verified. This claim is only returned when the client is granted the phone scope.
</ResponseField>

<ResponseField name="email" type="string">
  The end-user's email address. This claim is only returned when the client is granted the email scope.
</ResponseField>

<ResponseField name="email_verified" type="boolean">
  Indicates whether the end-user's email address has been verified. This claim is only returned when the client is granted the email scope.
</ResponseField>

<ResponseField name="name" type="string">
  The full name of the end-user. This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="given_name" type="string">
  The given (first) name of the end-user. This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="middle_name" type="string">
  The middle name of the end-user. This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="family_name" type="string">
  The family (last) name of the end-user. This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="picture" type="string">
  The URL of the end-user's profile picture. This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="locale" type="string">
  The end-user's locale, typically in the form of a language tag (e.g., "en-US"). This claim is only returned when the client is granted the profile scope.
</ResponseField>

<ResponseField name="request_id" type="string">
  Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
  may ask for this value to help identify a specific API call when helping you debug an issue.
</ResponseField>

<ResponseField name="status_code" type="number">
  The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
  equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
</ResponseField>

<Panel>
  <RequestExample>
    ```curl cURL theme={null}
    curl --request GET \
      --url https://${projectDomain}/v1/oauth2/userinfo \
      -H 'Authorization: bearer ${exampleConnectedAppAuthCode}'
    ```
  </RequestExample>

  <ResponseExample>
    ```json 200 theme={null}
    {
      "email": "sandbox@stytch.com",
      "email_verified": true,
      "name": "Jane Doe",
      "given_name": "Jane",
      "family_name": "Doe",
      "middle_name": "",
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "status_code": 200,
      "sub": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f"
    }
    ```

    ```json 404 theme={null}
    {
      "status_code": 404,
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "error_type": "idp_client_not_found",
      "error_message": "The IDP client requested could not be found.",
      "error_url": "https://stytch.com/docs/api/errors/404"
    }
    ```

    ```json 429 theme={null}
    {
      "status_code": 429,
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "error_type": "too_many_requests",
      "error_message": "Too many requests have been made.",
      "error_url": "https://stytch.com/docs/api/errors/429"
    }
    ```

    ```json 500 theme={null}
    {
      "status_code": 500,
      "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
      "error_type": "internal_server_error",
      "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
      "error_url": "https://stytch.com/docs/api/errors/500"
    }
    ```
  </ResponseExample>
</Panel>
