# API tokens

An API token authenticates requests you make to Datalore APIs, such as the [Run API](run-api.html) or Notebook API, so that you can interact with Datalore from external apps, scripts, and AI agents.

Include the token as a bearer token in the `Authorization` header of your requests.

Scope
: API tokens you create can have the following scopes:
:
:
:
: * Notebook API
:
: * Full user access
:
: * Admin access

Expiration period
: When creating an API token, you can select one of the expiration period options ranging from 30 minutes to one year.

Procedure: Access the API tokens tab

1. From the Home page or the editor, click your avatar at the top right.

2. Select Account settings.

![Opening Account settings from the Home page](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/account-settings.png)

3. Switch to the API tokens tab.

The list contains all tokens you have created and not deleted, including expired ones.

Procedure: Create an API token

1. On the [API tokens tab](#access-api-tokens-tab), click Create token.

2. In the dialog, enter the token name.

3. Select the scope and expiration period for the token and click Create.

4. Copy the token and save it in a secure location.

> **Note:**
> You will not be able to access the token again after you close the dialog.

Procedure: Create an API token for one notebook

You can also create an API token that has a scope of only one notebook.

1. Open the notebook you want to create a token for.

2. In the main menu, select `Tools | API token`.

3. In the dialog, enter the token name.

4. Select the expiration period for the token and click Create.

5. Copy the token and save it in a secure location.

> **Note:**
> You will not be able to access the token again after you close the dialog.

You can manage this token on the [API tokens tab](#access-api-tokens-tab).

Procedure: Revoke an API token

1. On the [API tokens tab](#access-api-tokens-tab), find the token you want to revoke.

2. Click x (Delete) next to it and confirm deletion.

