# API credentials

> The API Credentials tab of the Developers page shows the single API key of a Safecube workspace to Admins and Owners, who can copy it or rotate it, the old key stopping working at once.

The **API Credentials** tab of the **Developers** page shows the API key of your workspace. Your applications, your ERP or TMS, and the Salesforce integration send this key with every request to the Safecube API. A workspace has a single key: the tab shows it, copies it and replaces it.

## Who can open API Credentials

| Gesture | Minimum role | Plan |
| ------- | ------------ | ---- |
| Open **Developers** and the **API Credentials** tab | Admin | Every plan |
| View and copy the key | Admin | Every plan |
| Rotate the key | Admin | Every plan |

An Editor or a Viewer does not see **Developers** in the sidebar, and a link to `/api/credentials` takes them to the access denied page. Roles are described in [Users and roles](/en/platform/workspace/users-and-roles).

## Open API Credentials

1. Select **Developers** in the sidebar. When the sidebar is collapsed, its icon reads **API Access**.
2. The page opens on the **API Credentials** tab. The **Webhooks** tab next to it is described in [Webhooks console](/en/platform/developers/webhooks-console).

The address `https://app.safecube.ai/api/credentials` opens the tab directly, and any other address under `/api` leads to it. When the key cannot be loaded, the toast "Failed to retrieve API credentials. Please try again later." appears and the app shows an error page.

![API Credentials tab with the masked API key, the Rotate API key button and the two documentation cards](https://docs.safecube.ai/media/images/shared/api-credentials--default.webp?v=faab828f)

## View and copy the key

The **API Key** card reads "This key must be kept confidential". The key is masked by default.

1. Select the eye button, **Display key**, to show the key in clear. Select it again to mask it.
2. Select **Copy key** to copy the key to the clipboard. The button copies the full key even while it is masked, and shows no confirmation message.

![API Key card with the key displayed in clear after selecting Display key](https://docs.safecube.ai/media/images/shared/api-credentials--key-visible.webp?v=f413f21a)

The key gives access to the data of your whole workspace. Keep it on your servers, never in a web page, a shared document or a public code repository.

## Rotate the key

Rotating replaces the key with a new one. The current key is invalidated at once, with no grace period: every application, script or integration that still sends it, Salesforce included, stops working until you give it the new key. Webhooks already set up keep delivering their events.

1. Select **Rotate API key**.
2. The **Warning: API Key Rotation** dialog reads "This action is irreversible. Your current API key will be permanently invalidated and any application still using it will stop working immediately.".
3. Select **Rotate** to confirm, or **Cancel** to keep the current key.

![Warning: API Key Rotation dialog with the Cancel and Rotate buttons](https://docs.safecube.ai/media/images/shared/modal-rotate-api--default.webp?v=5d3a48dd)

On success, the dialog closes, the toast "Your API key has been rotated successfully." appears and the card shows the new key. Copy it and update every application that used the old one.

On failure, the toast "Failed to rotate API key. Please try again later." appears and the dialog shows **Server error** with **Retry**. The current key stays valid.

## Use the key

The tab does not test the key. How to send it with a request, in the `API_KEY` header, is described in the [Authentication](/en/api/getting-started/authentication) guide of the API documentation. The **Reference documentation** and **Quick start guide** cards of the tab open the API documentation in a new tab.

Short answers to frequent API questions, such as the rate limit or the choice between polling and webhooks, are in the [API and integration FAQ](/en/faq/api).

## Limits

- A workspace has one key: the tab does not create a second key, name a key or show its creation date.
- The tab keeps no history of the previous keys, and a rotated key cannot be restored.
- Rotating does not update the key in your applications or in Salesforce: paste the new key there yourself.
