OAuth2

Generate a V3 API access token with your Client ID and Client Secret, then send it as a Bearer token.

Last updated

On this page

Overview

Athena XAI authenticates APIs using the OAuth 2.0 standard. Follow the flow on this page to use Athena XAI APIs.

V3 Authentication is already included in the Athena XAI Headless frontend package. If you use that package, you can skip this step, because it is already implemented there.

Get your client credentials

  1. Log in to the Athena XAI Admin dashboard using the credentials and URL provided by the Athena XAI team.
  2. Click the Profile dropdown on the upper right side of the dashboard page.
  3. Choose the “Profile” button. Your Client ID and Client Secret are there.
  4. Store these credentials safely on your platform and use them to generate access tokens.

Generate an access token

Use the oauth/token API to generate access tokens.

MethodPath
POST{{athena_url}}/oauth/token

Request body

JSON
{
    "client_id" : {{client_id}},
    "client_secret" : "{{client_secret}}",
    "grant_type" : "client_credentials",
    "scope" : "*"
}

Successful response

JSON
{
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "{{access_token}}"
}

Use the access token

The response contains your access token. Send it as a Bearer token in all API calls.