> ## Documentation Index
> Fetch the complete documentation index at: https://help.csvbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API and encryption keys

> Find, copy and regenerate your CSVbox API key and secret key, and set up the encryption key used to decrypt encrypted environment variables.

The **API & Encryption Keys** page holds the credentials your code uses to call CSVbox: the API key and API secret key, and the encryption key that CSVbox uses to decrypt [encrypted environment variables](https://help.csvbox.io/advanced-installation/environment-variables.md). Open it from the user menu in the top right of the dashboard: **API Keys**.

## Whose keys you see

Keys belong to a workspace, not to each person.

* In your **personal account**, the page shows your own keys.
* In a **team**, the page shows the team owner's keys. Everyone in the team uses the same keys. The card says which team the keys belong to and, for members other than the owner, who owns them.

If you belong to a team and also have your own account, you see different keys depending on which one you have open.

## API keys

The **API Keys** card shows two values:

| Field | Used for |
| - | - |
| **API Key** | Identifies your account. Sent as the `x-csvbox-api-key` header on API requests. |
| **API Secret Key** | Authenticates server-side requests. Sent as the `x-csvbox-secret-api-key` header on the [Sheet API](https://help.csvbox.io/advanced-installation/sheet-api.md), and used to connect integrations such as Zapier and Airtable. |

Both values are masked. Click the eye icon to show a value, or **Copy** to copy it to the clipboard.

If a key doesn't exist yet, click **Generate Key** or **Generate API Secret Key**.

> [!WARNING]
>
> Keep the API secret key on your server. Don't put it in front-end code or share it publicly.

### Regenerate a key

Click **Regenerate Key** or **Regenerate API Secret Key**, then confirm.

* The current key stops working the moment you confirm.
* Every integration that uses it fails until you update it with the new key: REST API calls, Zapier, Airtable and any other connected app.
* The old key can't be recovered.

Update everything that uses the key straight after you regenerate it.

> [!NOTE]
>
> In a team, only the team owner can generate or regenerate the API keys. Other members who click the button see **Only the team owner can change API keys** and can ask the owner, or switch to their own account to use their own keys.

## Encryption keys

The **Encryption Keys** card configures how your app encrypts values that it passes to the importer as environment variables. Your app encrypts them with this key; CSVbox decrypts them when the import runs. See [Environment variables](https://help.csvbox.io/advanced-installation/environment-variables.md) for how to pass encrypted values.

### Encryption type

| Option | Description |
| - | - |
| **GCM** (recommended) | The strongest option. Encrypts the data and also detects if anyone has changed it on the way. |
| **CBC** | Also secure, with a tamper check. Choose it if your system can't use GCM. |
| **Legacy CBC** (not recommended) | An older format kept for existing setups. It has no tamper check, so avoid it for sensitive data. |

New accounts start on **GCM**.

### Encryption mode

Choose **Base64** or **Binary** to match how your app encodes the encrypted output. New accounts start on **Base64**. This option isn't shown for Legacy CBC.

> [!WARNING]
>
> Your app must encrypt data with the type and mode you choose here. Update your code before you save a change, or imports that send encrypted values can't read them.

### Encryption key

Click **Generate Encryption Key** to create a key, or paste your own key into the **Encryption Key** field. Then click **Save**.

* The first time, a generated key only fills the field. It isn't applied until you click **Save**.
* After settings are saved, **Regenerate Encryption Key** replaces the stored key straight away. Data encrypted with the old key can't be decrypted with the new one, and the old key can't be recovered. Update your app with the new key.
* Changes to the type and mode apply only when you click **Save**.

If encrypted values can't be decrypted, for example because the key or mode doesn't match, the import continues without them.

## Who can see this page

| Role | Access |
| - | - |
| Personal account | Full access to its own keys. |
| Super Admin (team owner) | Sees, copies and regenerates the team's API keys, and manages encryption settings. |
| Admin, Tech | Sees and copies the team's API keys, and manages encryption settings. Can't regenerate the API keys. |
| Finance | No access. The **API Keys** menu item isn't shown. |

See [Teams](https://help.csvbox.io/account/teams.md) for more about roles.

## Related

* [Environment variables](https://help.csvbox.io/advanced-installation/environment-variables.md)
* [Auth API](https://help.csvbox.io/advanced-installation/auth-api.md)
* [REST File API](https://help.csvbox.io/advanced-installation/rest-file-api.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.