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

# Access Token

> This endpoint authenticates the user and returns a unique token for subsequent requests.

## Body

<ParamField body="grant_type" type="string" required>
  Method used for obtaining a token. For obtaining new access tokens use "refresh\_token".
</ParamField>

<ParamField body="refresh_token" type="string" required>
  The Token that can be used to obtain a new access token.
</ParamField>

## Response

<ResponseField name="refresh_token" type="string" required>
  Token that can be used to obtain a new access token when the current one expires.
</ResponseField>

<ResponseField name="access_token" type="string" required>
  Token returned after successful authentication. Use this token for "Authorization" in subsequent requests.
</ResponseField>

<ResponseField name="token_type" type="string">
  Type of token. Commonly "Bearer".
</ResponseField>

<ResponseField name="expires_in" type="number">
  Duration (in seconds) before the token expires.
</ResponseField>

## Examples

### cURL:

```bash theme={null}
Request:
curl -X POST 'https://{{ BASE_URL }}/v1/auth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
  "grant_type": "refresh_token",
  "refresh_token": "dGhpc2lzYXNhbXBsZXJlZnJlc2h0b2tlbg.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQss233x"
}'

Response:
{
  "refresh_token": "dGhpc2lzYXNhbXBsZXJlZnJlc2h0b2tlbg.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQss233x",
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "token_type": "Bearer",
  "expires_in": 3600,
}
```
