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

# Authentication

> Obtain an access token using OAuth 2.0 Client Credentials

## Request Access Token

Accepts a JSON request body for the Client Credentials Grant and returns an access token.

<ParamField body="client_id" type="string" required>
  Your Auth0 client ID from the Telzino dashboard
</ParamField>

<ParamField body="client_secret" type="string" required>
  Your Auth0 client secret
</ParamField>

<ParamField body="audience" type="string" required>
  API audience. Use `https://api.telzino.com/`
</ParamField>

<ParamField body="grant_type" type="string" required>
  Must be `client_credentials`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.telzino.com/oauth/token \
    -H "Content-Type: application/json" \
    -d '{
      "client_id": "YOUR_CLIENT_ID",
      "client_secret": "YOUR_CLIENT_SECRET",
      "audience": "https://api.telzino.com/",
      "grant_type": "client_credentials"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.telzino.com/oauth/token', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      client_id: 'YOUR_CLIENT_ID',
      client_secret: 'YOUR_CLIENT_SECRET',
      audience: 'https://api.telzino.com/',
      grant_type: 'client_credentials'
    })
  });

  const { access_token } = await response.json();
  ```

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

  response = requests.post(
      'https://api.telzino.com/oauth/token',
      json={
          'client_id': 'YOUR_CLIENT_ID',
          'client_secret': 'YOUR_CLIENT_SECRET',
          'audience': 'https://api.telzino.com/',
          'grant_type': 'client_credentials'
      }
  )

  access_token = response.json()['access_token']
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token_type": "Bearer",
    "expires_in": 86400
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid_request",
    "error_description": "Missing required parameter: client_id"
  }
  ```
</ResponseExample>

## Get Current Account

After obtaining an access token, you can retrieve the account ID associated with your credentials.

```bash theme={null}
curl https://api.telzino.com/v1/me \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

**Response:**

```json theme={null}
{
  "account_id": "m5b6g5jd-lanh-47yi-yhsg-cx56wjdah8h9"
}
```
