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

# Get authentication token

# Body

The request body have to be sent in `x-www-form-urlencoded` format

<ParamField body="client_id" type="string" required>
  Client ID. You can generate a client credentials on [Allyy settings page](https://app.allyy.io/settings/clients)
</ParamField>

<ParamField body="client_secret" type="string" required>
  Client Secret. You can generate a client credentials on [Allyy settings page](https://app.allyy.io/settings/clients)
</ParamField>

<ParamField body="grant_type" type="string" default="client_credentials" initialValue="client_credentials" placeholder="client_credentials" required>
  Always `client_credentials`
</ParamField>

<ParamField body="allyy_api" type="string" default="allyy_api" initialValue="allyy_api" placeholder="allyy_api" required>
  Always `allyy_api`
</ParamField>

# Headers

<ParamField header="Content-Type" type="string" default="application/x-www-form-urlencoded" initialValue="application/x-www-form-urlencoded" placeholder="application/x-www-form-urlencoded" required>
  Only `application/x-www-form-urlencoded` supported
</ParamField>

# Responses

<ResponseField name="access_token" type="string" required>
  Access token to be used for authentication
</ResponseField>

<ResponseField name="token_type" type="string" required>
  Token type
</ResponseField>

<ResponseField name="expires_in" type="integer" required>
  Validity periot in seconds
</ResponseField>

<ResponseField name="scope" type="string" required>
  Available scopes
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "access_token": "my bearer token",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "allyy_api oneprediction_api"
  }
  ```

  ```json 400 theme={null}
  {
    "error": "invalid_request"
  }
  ```
</ResponseExample>
