> For the complete documentation index, see [llms.txt](https://knowledgebase.fabricdata.com/studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.fabricdata.com/studio/admin-and-configuration/api-key-management.md).

# API Key Management

### Video guide: API key management

{% embed url="<https://www.loom.com/share/5f34d0f039414d9a84e24e41a28a043f>" %}

### Creating an API Key

1. Open the role menu in the top-right corner and select **Administrator**
2. Go to **API Keys** and select **Generate Key**
3. Complete the fields:
   * **Name**: a descriptive label so you can identify the key later (e.g. *Rightsline integration – Production*)
   * **Role**: the role the key acts as. The key inherits that role's permissions
   * **Expires**: how long the key remains valid (see below)
4. Select **Save**, then copy and store the key securely

{% hint style="warning" %}
The full key is only shown once. \[Confirm: is this true?] If you lose it, generate a new key.
{% endhint %}

***

### Key Expiration

Every API key has an expiry period, set when the key is created. Time-limited keys reduce risk: if a key is ever exposed, it stops working automatically rather than remaining valid indefinitely.

#### Available periods

| Option   | Typical use                                    |
| -------- | ---------------------------------------------- |
| 30 days  | Short-term testing, one-off migrations         |
| 60 days  | Pilot or proof-of-concept integrations         |
| 90 days  | **Default.** Recommended for most integrations |
| 180 days | Stable production integrations                 |
| 365 days | Long-running integrations with a rotation plan |

The expiry period is counted from the date the key is created. \[Confirm]

\[Confirm: can admins set a tenant-wide maximum, or allow keys that never expire? If so, document where that setting lives here.]

#### What happens when a key expires

* The key stops authenticating immediately
* Any request using it returns `401 Unauthorized`
* Expired keys cannot be extended or reactivated. Generate a new key instead \[Confirm]

\[Confirm: are users notified before expiry? Only add this once the notification behaviour ships.]

***

### Rotating a Key

To avoid downtime, replace a key **before** it expires:

1. Generate a new key with the same role
2. Update your integration or secrets manager to use the new key
3. Confirm requests are succeeding with the new key
4. Revoke the old key

{% hint style="info" %}
Add each key's expiry date to your team's calendar or secrets manager so rotation is planned rather than reactive.
{% endhint %}
