> 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-api-credentials.md).

# Generate API credentials

This article describes how to generate a new set of API credentials for an existing API service account.

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

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

As a workspace **Owner** or **Super Admin**, you can generate a new set of API credentials for an existing API service account. Generating new API credentials lets you rotate access without downtime: update your integration to use the new API credentials, then revoke the old ones once the switch is complete.

## Requirements

The following are the requirements to generate API credentials:

* An existing API service account
* Fewer than 2 active API credential sets for that API service account. An API service account can have at most 2 active API credential sets at a time.

To generate API credentials, you must complete the following steps:

1. [Configure the credentials](#1-configure-the-credentials)
2. [Save your credentials](#2-save-your-credentials)

The following sections describe each step.

## 1. Configure the credentials

To configure the new API credentials, you must complete the following steps:

{% hint style="info" %}
**NOTE:** You can also start this procedure from the **API service accounts** table by selecting **Generate credentials** from the actions menu next to the API service account.
{% endhint %}

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 service accounts** left tab.
4. Click the API service account you want to generate credentials for. The **Service account details** page is displayed.
5. Click the **Generate API credentials** button. The **Generate new API credentials** dialog box is displayed.
6. Select an expiration option from the **Expiration** drop-down list:

   * **7 days**
   * **1 month**
   * **3 months**
   * **6 months**
   * **Custom date**
   * **Never**

   If you select **Custom date**, a calendar is displayed in the same drop-down list. Select a date, then click **Apply**. Click **Cancel** to close the calendar without selecting a date.
7. Click the **Generate** button. Cerby generates the new API credentials, and the **Save your API credentials** step of the dialog box is displayed.

{% hint style="info" %}
**NOTE:** To avoid downtime, update your integration to use the new API credentials first, then revoke the old API credentials once the switch is complete.
{% endhint %}

## 2. Save your credentials

To save the new API credentials, you must complete the following steps:

{% hint style="warning" %}
**IMPORTANT:** Copy and store the client secret before you continue. Cerby displays it only once, and you cannot view it again.
{% endhint %}

{% hint style="info" %}
**NOTE:** Instead of manually confirming that you've stored the secret, you can save the client ID and client secret directly to a Cerby vault. Click the **Save in Cerby** button, select a vault from the list, then click the **Save** button. Cerby saves the credentials as a secret in the selected vault and selects the confirmation checkbox for you.
{% endhint %}

1. Copy the **Client ID** and **Client secret** displayed in the dialog box.
2. Select the checkbox confirming that you've stored the secret securely.
3. Click the **Done** button.

The new API credentials appear in the **Credentials** section of the service account's details page.

Now you are done.

## Related articles

* [Create an API service account](https://help.cerby.com/developer-tools/cerby-api/create-an-api-service-account.md)
* [Edit the permissions of an API service account](https://help.cerby.com/developer-tools/cerby-api/edit-the-permissions-of-an-api-service-account.md)
* [Revoke API credentials](https://help.cerby.com/developer-tools/cerby-api/revoke-api-credentials.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
