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

# Authentication

[//]: # "### Authentication"

Voight APIs use OAuth 2.0 for authentication.

To authenticate, you need to obtain an access token by following these steps:

1. **Create Your Auth Tokens**: In your <a href="https://voight.ai/organizations" target="_blank" rel="noreferrer" className="link">organization page</a>, create your auth tokens in order to obtain your `client_id` and `client_secret`.
2. **Request an access token**: Using your `client_id` and `client_secret`, make a request to the token endpoint as follows:
   * **URL**: `https://human-artistree-prod.auth.us-east-1.amazoncognito.com`
   * **Endpoint**: `/oauth2/token`
   * **Method**: `POST`
   * **Content-Type**: `application/x-www-form-urlencoded`
   * **Body Parameters**:
     * `grant_type`: Set to `client_credentials`
     * `client_id`: Your client ID
     * `client_secret`: Your client secret

<div className="-mb-4 -mt-4">
  ### Example Request

  <CodeGroup>
    ```nushell cURL icon="terminal" lines theme={"system"}
    curl --location 'https://human-artistree-prod.auth.us-east-1.amazoncognito.com/oauth2/token' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'grant_type=client_credentials' \
      --data-urlencode 'client_id=YOUR_CLIENT_ID' \
      --data-urlencode 'client_secret=YOUR_CLIENT_SECRET'
    ```

    ```python Python icon="python" lines theme={"system"}
    import requests

    url = "https://human-artistree-prod.auth.us-east-1.amazoncognito.com/oauth2/token"

    payload = "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
    headers = {
        "Content-Type": "application/x-www-form-urlencoded",
    }

    response = requests.request(method="POST",
                                url=url,
                                headers=headers,
                                data=payload)

    print(response.text)
    ```

    ```http HTTP icon="webhook" lines theme={"system"}
    POST /oauth2/token HTTP/1.1
    Host: human-artistree-prod.auth.us-east-1.amazoncognito.com
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 132

    grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET
    ```
  </CodeGroup>
</div>

<div>
  ### Example Response

  ```json JSON icon="js" lines theme={"system"}
  {
    "access_token": "YOUR_ACCESS_TOKEN",
    "token_type": "Bearer",
    "expires_in": 3600
  }
  ```
</div>

3. **Use the access token**: Include the `access_token` in the `Authorization` header of your API requests as follows:

```http HTTP icon="webhook" lines theme={"system"}
Authorization: Bearer YOUR_ACCESS_TOKEN
```
