# Authentication

> For the complete documentation index, see [llms.txt](https://developer.fluxir.com/llms.txt).

How to authenticate with the Fluxir API

This guide explains how to authenticate with the Fluxir Travel API using the OAuth 2.0 `client_credentials` flow. You’ll learn how to activate your API Client in the Travel Agencies Portal and obtain an access token to authorize your API requests.

## Prerequisites

Before you begin, make sure you have:

- Access to the [Travel Agencies Portal](https://app.fluxir.com).

> **Billing readiness before paid submission**
>
> Before using API credentials for paid or billing-sensitive workflows, review the [API Billing Readiness guide](https://developer.fluxir.com/api-guides/billing-readiness/). Headless API clients should check tenant readiness before submission; Stripe Checkout remains a portal interaction, not the required headless API billing flow.

## Generating an Access Token

**1.**

### Activate an API Client

To activate an API client:

1. Go to [https://app.fluxir.com](https://app.fluxir.com).

2. Navigate to the <strong>Settings</strong> page.

3. Click on the <strong>API Client Management</strong> tab.

4. Press the <strong>Activate API Client</strong> button.

A box displaying your <strong>Client Secret</strong> will appear, similar to the image below:

This secret is shown only once. Copy and store it securely. However, you can regenerate it later if necessary.

After activation, you will have the following credentials:

- <strong>Client ID</strong>

- <strong>Client Secret</strong>

- <strong>Tenant ID</strong>

These are required to request an access token in the next step.

**2.**

### Get an Access Token

Send a `POST` request to the token endpoint:

```text
POST https://auth.fluxir.com/connect/token
```

<strong>Headers</strong>:

- `Content-Type: application/x-www-form-urlencoded`

- `X-Tenant:`

<strong>Payload</strong>:

- `grant_type`: `client_credentials`

- `scope`: `TravelAideAPI`

- `client_id`: your Client ID

- `client_secret`: your Client Secret

```bash
curl --request POST 'https://auth.fluxir.com/connect/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'X-Tenant: ' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'client_id=' \
  --data-urlencode 'client_secret=' \
  --data-urlencode 'scope=TravelAideAPI'
```

```json
{
  "access_token": "",
  "expires_in": 31536000,
  "token_type": "Bearer",
  "scope": "TravelAideAPI"
}
```

> **Keep your credentials safe**
>
> Never share your `client_id`, `client_secret`, or `access tokens` in public places such as GitHub repositories, forums, or others.
>
> These credentials grant access to your tenant’s data and must be treated as sensitive information.

## Using the Generated Access Token

Once you obtain the access token, include it in the Authorization header of every API request.

```sh
curl --request GET 'https://api.fluxir.com/api/app/travel-services' \
--header 'Authorization: Bearer <ACCESS_TOKEN_VALUE>' \
--header 'X-Tenant: <YOUR_TENANT_ID>' \
--header 'Accept: application/json'
```