# API keys

## Accessing the API Key Page

There are multiple ways to navigate to the **API Keys** page:

### From the Project Dashboard

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FEri8nVfEpntc7kP003LK%2FCreate%20API%20Key%20Light%20mode%20.png?alt=media&#x26;token=2ea787bd-5437-4fca-83cb-101eb4234e66" alt=""><figcaption></figcaption></figure>

1. Open your **Project Dashboard**.
2. Click on **Create an API Key** to access the API Key management page.

### From the User Panel

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2F3a6GKPvk2y57bQEBB1EC%2FCleanShot%202025-02-17%20at%2012.52.32.png?alt=media&#x26;token=0a9db65c-fbba-4c3e-ad99-63002b182c58" alt=""><figcaption></figcaption></figure>

1. Locate the **left-side panel** of the interface.
2. Click on the **API Keys** option to navigate directly to the API management page.

### Using a Keyboard Shortcut

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FosFcmQxXjpMAvRjrO5Gh%2FCreate%20api%20key%20with%20cmd%20k.gif?alt=media&#x26;token=1f49b378-3499-470c-9be0-d07d888f77a3" alt=""><figcaption></figcaption></figure>

1. Press **Cmd + K** (Mac) or **Ctrl + K** (Windows) to open the **Quick Menu**.
2. Type **"API Key"** in the search bar.
3. Select **Manage API Keys** to be redirected to the API Key page.

***

## Creating a New API Key

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FCKgmPxjxUN5N0kDx4GJM%2FApi%20Key.gif?alt=media&#x26;token=1c281744-51d5-4e29-9950-b22d96e07947" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
🚨 **Important:** Once created, the API key will only be shown **once**. Make sure to copy and store it securely.
{% endhint %}

To generate a new API Key:

{% stepper %}
{% step %}
Navigate to the **API Keys** page.

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FnhBl8FfqTh6eVrNvDeLI%2FCreate%20API%20Key%20Light%20mode%20.png?alt=media&#x26;token=00246680-5031-4d44-973e-526f35d37634" alt=""><figcaption></figcaption></figure>

Click on **Create New Token**&#x20;

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FPBXC326tMYdqg6eaRSMY%2FAPI%20Keys%20page%20.png?alt=media&#x26;token=41760c8c-ad63-46f6-9b51-0994f4b3f9a2" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Enter a **name** for your API key.

This should something easily identifiable for future reference.
{% endstep %}

{% step %}
Set the expiration period for the key.

For additional security, you can choose to have the token become non-functional after a set period of time.
{% endstep %}

{% step %}
Set the scope of the key.

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2F4NaLF9UcdJeKvyaJbSm8%2FCreate%20new%20PAT%20.png?alt=media&#x26;token=004bd32e-02d0-446a-8278-27b7969034c2" alt=""><figcaption></figcaption></figure>

Choose the data and actions that users and tools using the token can access and perform.

{% hint style="success" %}
If you're using the [tokens-studio-for-figma-plugin](https://documentation.tokens.studio/plugins/tokens-studio-for-figma-plugin "mention") or the [companion-by-tokens-studio](https://documentation.tokens.studio/plugins/companion-by-tokens-studio "mention") plugin, you'll need to enable `project:read` , `project:write` and `actor_tokens:create`
{% endhint %}

| Scope                       | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `me:read`                   | Read account data for the currently logged in user. |
| `organizations:read`        | Read data about the organization                    |
| `organizations:write`       | Update data and settings for the organization       |
| `organizations:admin`       | Administer organization data                        |
| `organizations:user:read`   | Read data regarding the users in an organization    |
| `organizations:user:invite` | Can invite users to an organizations                |
| `organizations:user:write`  | Can update user data in an organization             |
| `projects:read`             | Read project data directly                          |
| `projects:write`            | Update project data                                 |
| `projects:admin`            | Administer Projects                                 |
| `actor_tokens:create`       | Create actor tokens for the user                    |
| {% endstep %}               |                                                     |
| {% endstepper %}            |                                                     |

***

## Managing API Keys

* The **API Keys** page displays a list of previously created keys.
* You can **delete** old keys when they are no longer needed.
* For security, API keys **cannot be viewed again** after creation.

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FfNWOIfNxnokERcKoB9vr%2FPeronsal%20Access%20Tokens.png?alt=media&#x26;token=da545329-da73-448d-b35f-d5210bdbaa05" alt=""><figcaption></figcaption></figure>

***

## Using API Keys

* API keys can be used to authenticate connections between **Studio** and **Figma** (or other external platforms).
* They are tied to your **user account**, meaning they grant access to all organizations and projects you are part of.

For more details on using API keys for **Figma integration**, refer to the [Connecting Studio to Figma](https://documentation.tokens.studio/connect-studio-to-figma) guide.

***

### Security Best Practices

* Store API keys in a **secure password manager**.
* Avoid sharing API keys publicly or committing them to version control.
* Regularly **rotate** keys to maintain security.

***

### Related&#x20;

* [connect-studio-to-figma](https://documentation.tokens.studio/connect-studio-to-figma "mention")
* [connect-studio-to-code](https://documentation.tokens.studio/connect-studio-to-code "mention")
* [using-tokens-studio-for-figma](https://documentation.tokens.studio/connect-studio-to-figma/using-tokens-studio-for-figma "mention")
* [using-companion-by-tokens-studio](https://documentation.tokens.studio/connect-studio-to-figma/using-companion-by-tokens-studio "mention")
