> For the complete documentation index, see [llms.txt](https://help.cerby.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cerby.com/developer-tools/cerby-api/generate-an-api-key.md).

# Generate an API key

{% hint style="info" %}
**Who can use this feature?**

* Workspace **Owners**, **Super Admins**, and **Admins**
* Only supported using the Cerby web app
  {% endhint %}

As a workspace **Owner**, **Super Admin**, or **Admin**, you can generate an API key to authenticate requests to the Cerby API. You can create multiple keys, each with a different scope set and expiration time.

To generate an API key, complete the following steps:

1. [Configure the API key details](#1-api-key-details)
2. [Select the scopes](#2-select-scopes)
3. [Store your API key](#3-store-your-api-key)

The following sections describe each step.

## 1. API key details

Complete the following steps to start the wizard and configure your API key:

1. Log in to your [Cerby](https://app.cerby.com/) workspace.
2. Select the **Settings** option from the left menu. The **Workspace Configuration** page is displayed.
3. Select the **API keys** left tab.
4. Click the **Generate API key** button. The **Generate API key** wizard is displayed.
5. Enter a name for the API key in the **API key name** field.
6. Select an expiration time from the **Expiration time** drop-down list:
   * **1 hour**
   * **12 hours**
   * **1 day**
   * **5 days**
   * **1 year**
   * **Custom**
7. Click the **Next** button. The **Select scopes** page is displayed.

## 2. Select scopes

Complete the following steps to select the scopes for your API key:

1. Select the scopes you want to assign to the API key:

   **Read**

   * **Read activities:** Enables reading activity data.
   * **Read items:** Enables reading account, secret, and collection data.
   * **Read accounts:** Enables reading account data.
   * **Read secrets:** Enables reading secret data.
   * **Read users:** Enables reading user and team data.
   * **Read integrations:** Enables reading integration and entitlement data.
   * **Read automated jobs:** Enables reading automated job data.
   * **Read vaults:** Enables reading **Vaults** data.
   * **Read teams:** Enables reading **Teams** data.

   **Write**

   * **Write accounts:** Enables writing accounts data.
   * **Write secrets:** Enables writing **Secrets** data.
   * **Write users:** Enables writing user and team data.
   * **Write integrations:** Enables writing integration and entitlement data.
   * **Write automated jobs:** Enables writing automated job data.
   * **Write collections:** Enables writing **Collections** data.
   * **Write teams:** Enables writing **Teams** data.

   **Delete**

   * **Delete teams:** Enables deleting **Teams** data.
2. Click the **Next** button. The **Store your API key** page is displayed.

## 3. Store your API key

Complete the following steps to copy and store your API key:

{% hint style="danger" %}
**IMPORTANT:** Copy your API key before leaving this page. This is the only time Cerby displays the key in plain text. If you leave without copying it, you must generate a new key.
{% endhint %}

1. Copy the API key displayed on the page.
2. Choose one of the following options:

   * To save the key as a Cerby secret: click the **Save in Cerby** button. The **Save your API key in Cerby?** page is displayed. Select a vault from the **Select vault** drop-down list, and click the **Save in Cerby** button. If you only have one vault, the **Select vault** drop-down list is not displayed.
   * To skip saving to Cerby: select the **I have stored the key in a safe place** checkbox. Click the **Done** button.

   The wizard closes and the new key appears in the **API keys** table with the **Active** status.

You can start using the API key to [authenticate your API requests](https://developer.cerby.com/#authentication) by including it in the **X-API-Key** header.

Now you are done.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.cerby.com/developer-tools/cerby-api/generate-an-api-key.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
