# API

Connect your Chatlayer [Table](https://docs.chatlayer.ai/navigation/tables) with your API to your database.

{% hint style="warning" %}
For importing more than 100 records, using an API is recommended over manual data import.
{% endhint %}

{% hint style="danger" %}
Please note that Tables cannot be exported at[ bot export](https://docs.chatlayer.ai/navigation/settings/import-export) yet.
{% endhint %}

{% hint style="info" %}
Please find the API documentation and authorization [here](https://gateway.prod.europe-west1.gc.chatlayer.ai/api/v1/docs/static/index.html).&#x20;
{% endhint %}

## How to authenticate

The API requires basic authentication. Follow these guidelines to find the username and password when making an API request.

1. Go to **Settings.**&#x20;
2. Click on **Access tokens.**
3. From the top-right corner, click on **Generate token.**
4. Enter a **Token name**.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FmVJYY9bcT11aWce2H7el%2FScreenshot%202024-07-01%20at%2022.19.53.png?alt=media&#x26;token=b0671974-5016-46b1-86d4-d3f757a74ac2" alt=""><figcaption></figcaption></figure>

5. Click on **Create.**
6. **Copy** the token.

{% hint style="info" %}
A token consists of a username and a password. For example, the following is a generated token:

`66830fb161b3c29143f32705:78b3e20492db13584eE52C556F99a5d2`

The part before the colon (:) is the **username**, and the part after the colon is the **password**.

User name: `66830fb161b3c29143f32705`

`Password:78b3e20492db13584eE52C556F99a5d2`
{% endhint %}

{% hint style="info" %}
For the base URL, please use\
EU: <https://gateway.prod.europe-west1.gc.chatlayer.ai/api/v1>\
US: <https://gateway.prod.us-east4.gcp.chatlayer.ai/api/v1>\
SA: <https://gateway.prod.sa-east1.gcp.chatlayer.ai/api/v1>\
ASIA: <https://gateway.prod.asia-south1.gcp.chatlayer.ai>
{% endhint %}
