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

# Get the connected user identity (POST)

> Read the identity claims granted to an OAuth connection.

Read the identity claims granted to an OAuth connection.

```http theme={null}
POST https://api.voicecheap.ai/oauth/userinfo
```

## Authentication

Send an OAuth access token in Authorization: Bearer. The token must include openid; email claims also require email. API keys and query-string credentials are not accepted.

## Request examples

Follow the documented encoding and authentication for this route. The action API's envelope and idempotency rules apply only to action invocations.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST 'https://api.voicecheap.ai/oauth/userinfo' \
    --header "Authorization: Bearer $VOICECHEAP_ACCESS_TOKEN" \
    --header 'Content-Type: application/json' \
    --data '{}'
  ```

  ```javascript JavaScript theme={null}
  const input = {};
  const response = await fetch('https://api.voicecheap.ai/oauth/userinfo', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.VOICECHEAP_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(input),
    redirect: 'manual',
  });
  console.log(response.status, await response.text());
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.request(
      "POST",
      "https://api.voicecheap.ai/oauth/userinfo",
      headers={"Authorization":"Bearer " + os.environ["VOICECHEAP_ACCESS_TOKEN"],"Content-Type":"application/json"},
      json={},
      timeout=120,
      allow_redirects=False,
  )
  print(response.status_code, response.text)
  ```
</RequestExample>

## Response

Read the identity claims granted to an OAuth connection.

```json HTTP 200 theme={null}
{
  "sub": "voicecheap-user-id",
  "email": "customer@example.com",
  "email_verified": false
}
```

## Response headers

```json theme={null}
{
  "Cache-Control": "no-store",
  "Pragma": "no-cache"
}
```

## Operation notes

* OpenID Connect endpoints return HTTP 404 when identity integration is unavailable in this environment. Check discovery before relying on identity features.
* sub is the stable account identifier. email and email\_verified are included only when email was granted and the account has an email address. email\_verified reflects the actual verification status and may be false. Deleted or disabled accounts cannot use UserInfo.

## Errors

| HTTP status | Code | Meaning or recovery |
| - | - | - |
| 400 | `invalid_request` | Send the OAuth access token only in the Authorization header. API keys and access\_token/api\_key credentials in the query or body are rejected. |
| 401 | `invalid_token` | The OAuth access token is missing, invalid, expired, revoked, or no longer authorized. Reconnect the account. |
| 403 | `insufficient_scope` | The token lacks openid or the account no longer has eligible access. Reconnect with the required identity permission and an eligible account. Read the WWW-Authenticate challenge for details. |
| 404 | `invalid_request` | OpenID Connect endpoints return HTTP 404 when identity integration is unavailable in this environment. Check discovery before relying on identity features. |
| 429 | `temporarily_unavailable` | The public OAuth request rate limit was reached. Wait for the current window before retrying. |
| 500 | `server_error` | Authorization is temporarily unavailable. Retry later. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.