# Access token

## Request an access token

The first step in Travellerschoice Hotel API gateway interaction is to authenticate with the identity service and obtain an access token. This token grants authority to perform operations on the gateway APIs. Although each token expires after 10 minutes, you can generate a new one at any time using your  Account API key.

## Access token API

<mark style="color:green;">`GET`</mark> `/api/v1/client/tokens/generate`

**Headers**

| Name            | Value              |
| --------------- | ------------------ |
| Content-Type    | `application/json` |
| api-key         | `<Your API Key>`   |
| Accept-Encoding | `gzip`             |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "access_token": "20ed68855cc183dede3b36fb67e5",
    "expiryDate": "2024-10-13T22:24:09.323Z"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
"errors": [
        {
            "message": "Invalid api key"
        }
    ]
}
```

{% endtab %}
{% endtabs %}
