> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/documentation/security/api-keys-and-service-identities.md).

# API keys and service identities

Create API keys for scripts and the SDK, limit what each key can do, and rotate or delete keys.

An API key lets a script, the Python SDK or the CLI act in your workspace without a person signing in. Treat every key like a password.

## Create a key

1. Open **Settings > API keys** and select **Create new key**.
2. Enter a **Name** that says what uses it, such as *CI upload script*.
3. Choose its permissions:
   * **Full access**: every permission the SDK uses.
   * **Customize**: only the permissions you turn on, such as uploads and releases.
4. Select **Create key**, then copy the key.

![API keys page with each key's name, permissions and Enabled switch](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FwC11VBfAR3QgaulCobbD%2Fapi-keys.webp?alt=media)

You need the **Manage API keys** permission. You can only give a key the permissions your own role has, and you see and manage only keys within your role.

## Manage keys

| Action                | How                                                                                       |
| --------------------- | ----------------------------------------------------------------------------------------- |
| Show or copy a key    | **Show key** or **Copy key** in its row.                                                  |
| Pause a key           | Turn its **Enabled** switch off. Requests with it are refused until you turn it on again. |
| Change what it can do | **Edit permissions** in the row menu.                                                     |
| Delete a key          | **Delete API key** in the row menu. Scripts using it stop working at once.                |

## Good practice

* One key per script or integration, so you can turn one off without breaking the others.
* Use **Customize** and give a key only what it needs. A key that only exports releases doesn't need data upload.
* Keep keys in a secret manager or environment variable, never in code or notebooks you share.
* Rotate keys regularly: create a new key, update the script, then delete the old one.
* Viewing and revealing keys is recorded in the [audit log](https://docs.unitlab.ai/documentation/security/audit-log.md).

## Related

Permissions and custom roles · [Security overview](https://docs.unitlab.ai/documentation/security/security-overview.md)
