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

# Authenticate

> Exchange your API user's credentials for a bearer token.

No `Authorization` header is needed for this call. Limited to 10 calls per minute per IP. Cache the token: see [Authentication](https://developers.ttool.travel/authentication.md).

## Body

**username** `string` *required*

Your API user's username.

**password** `string` *required*

Your API user's password.

## Response

**accessToken** `string`

The bearer token.

**expiresIn** `integer`

Seconds until the token expires.

**tokenType** `string`

Always `Bearer`.

## Errors

| HTTP | `errorCode` |
| - | - |
| 401 | `INVALID_CREDENTIALS`, `AUTHENTICATION_FAILED` |
| 403 | `ACCOUNT_DISABLED`, `UNAUTHORIZED_ACCESS` |
| 429 | `RATE_LIMIT_EXCEEDED` |

```bash cURL theme={null}
curl -X POST "https://api.staging.ttool.travel/hub/api/v1/flights/authenticate" \
  -H "Content-Type: application/json" \
  -d '{ "username": "agency.api@example.com", "password": "********" }'
```

```json 200 theme={null}
{ "accessToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6...", "expiresIn": 3600, "tokenType": "Bearer" }
```

```json 401 theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "errorCode": "INVALID_CREDENTIALS",
    "errorMessage": "Invalid username or password.",
    "errorCategory": "Authentication",
    "httpStatusCode": 401
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.