> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from Project Keys

> Move existing integrations from Project Key (Legacy) credentials to personal or service keys. Create replacements, verify access and retire the old keys.

Replace an existing **Project Key (Legacy)** with a **Secret Key**: a service key for shared automation, or a personal key for work performed as yourself. Keep the project key active until every integration using it has been updated and verified.

## What changes

A Project Key (Legacy) belongs to one project. Secret Keys authenticate a user or service-account identity, with access to the resources and actions selected for that key. Updating the credential may also require updating the endpoint and supplying the project and Environment explicitly.

| Replacement | Who creates it | Use it for |
| --- | --- | --- |
| **Service key — recommended for shared integrations** | An organization administrator | Production services, CI and other automation with its own identity |
| **Personal key** | The individual user, including an editor | Local development and integrations that should act with that user's access |

**Note:** 
**Using Service and Personal Keys**

**Service keys:** Recommended for shared automation and production integrations. An organization administrator creates them with selected access, using a separate service-account identity. They can expire or be set to **Never**; plan manual replacement when choosing **Never**.

**Personal keys:** Editors can create their own without organization-admin access. They act with your account's permissions and must expire after 1, 7, 30, 90 or 365 days; the default is 30 days. There is no **Never** option. Create and deploy a replacement before the key expires.

## Prepare your integrations

Before changing a key:

- List every application, deployment, scheduled job and CI secret using the project's primary or secondary key. Record the endpoint and operations each consumer needs.
- Record the project ID and Environment each integration should use. Find **Project ID** in the project's **Settings → General → Metadata**. Keep the Environment alias already intended for that integration.
- Choose who will create the replacement. For a service key, give the organization administrator the required workspaces, projects and operations. Have them provision the key in the service's secret store and hand over its secret reference, access scope and expiry to the person updating the integration.
- Make sure someone with permission to update the project's API keys can retire the old keys after cutover.

**Warning:** 
Keep Secret Keys in your backend or secret store. Widget installations use [client keys](/docs/api-reference/authentication#client-keys), and Chat actions use the `sessionKey` returned when a session is created. Do not put a personal or service key into website installation code.

## Create and deploy the replacement

### Create a Secret Key

Choose one replacement type for each consumer. You do not need to create both types to complete a migration.

#### Service key (recommended)

### 1. Open Service keys as an organization administrator

Sign in to [Voiceflow](https://creator.voiceflow.com). Return to the workspace dashboard, click **Settings** at the bottom left, then **Service keys → New key**. If the list is empty, click **Create key**. If **Service keys** is disabled, ask an organization administrator to create the key.

### 2. Set the automation's access and expiry

Enter a recognizable name, such as `Release automation`. Under **Grant access to these workspaces**, **Grant access to these projects** and **With these permissions**, select the resources and actions the integration needs. Choose **Read-only**, **Read & write** or **Custom** to match its actual operations. Set **Expires** to the required lifetime, or **Never** if you will manage replacement yourself.

Create service key dialog with a Release automation name, resource selectors, permissions and expiry — An organization administrator chooses the service key's resources, permissions and expiry.

### 3. Create and store the service key

Click **Create**, then copy the full value from the confirmation dialog directly to the automation's secret store. The full key is shown once. Record the secret reference and expiry so the integration owner can deploy and replace it.

#### Personal key

### 1. Open your Personal keys settings

Sign in to [Voiceflow](https://creator.voiceflow.com) with your own account. From the workspace dashboard, click **Settings** at the bottom left, then **Personal keys → New key**. If the list is empty, click **Create key**. Editors can create their own personal keys here.

### 2. Choose your access and an expiry

Enter a recognizable name, such as `Local development`, and choose **Expires**. The default is **In a month**; the longest available lifetime is **In a year**. Where the access selectors are available, choose the workspaces, projects and action permissions the integration needs. A personal key cannot grant more access than your account has.

Create personal key dialog with a Local development name, expiry, project access and Read-only permissions — Create a personal key with the access and lifetime needed for your own work.

### 3. Create and store the personal key

Click **Create**, then copy the full value to your local credentials or backend secret store before closing the dialog. The full key is shown once. Record its expiry and schedule replacement before that date.

### Update the integration's requests

### 1. Check the endpoint and credential stage

Use the current reference for each endpoint. For Platform API requests and Chat session creation, send the new key as a Bearer token:

```http
Authorization: Bearer <secret-key>
```

For Chat, keep the Secret Key on the server for [session creation](/docs/api-reference/v4interact/start-session-specific-environment#credentials). Continue sending the returned `sessionKey` directly in `Authorization` for subsequent actions, without a Bearer prefix.

If an import uses the older `/v1alpha1/public/knowledge-base/document` endpoint, move it to the [Platform Document API](/docs/api-reference/document/create-url-document). That API accepts Secret Keys and takes an explicit `projectID` and `environmentAlias`; replacing the key alone does not migrate the old endpoint's request body or response fields.

### 2. Deploy the new secret to every consumer

Replace the legacy value in each application's secret store and deploy or restart it as required to load the new value. Keep the old project key active while you verify the replacement. For CLI automation, update `VF_TOKEN` and remove or update any explicit `--token` value that would override it.

## Verify the migration and remove old keys

### 1. Verify requests with the replacement

Test the operations each integration actually uses, against the intended project and Environment. A key appearing in the settings list does not establish that its permissions are sufficient.

For a read-only check, set `VF_TOKEN` from the new secret and `VF_PROJECT_ID` to the recorded project ID. The key must have permission to list Functions for this project and Environment:

```bash
curl --fail-with-body --get 'https://realtime-api.voiceflow.com/v1/stable/function' \
  --header "Authorization: Bearer $VF_TOKEN" \
  --data-urlencode "projectID=$VF_PROJECT_ID" \
  --data-urlencode 'environmentAlias=main'
```

Use the intended alias if it is not `main`. A successful JSON response, including an empty list, verifies this read operation only. Also test the Chat, Knowledge or other operations that each consumer depends on. Keep a record of which consumers have passed before retiring either old key.

### 2. Revoke the old project keys

After every consumer has passed with its replacement, open the original project in Voiceflow, then **Settings → API keys**. If a **Secondary key** is listed, open its **More** menu, choose **Revoke secondary key**, read the confirmation and click **Yes**. Then open the primary key's **More** menu and choose **Revoke primary key → Yes**.

Project API keys settings with the secondary key's More menu open and Revoke secondary key available — Open the secondary key's More menu after its consumers have moved to Secret Keys.

Native confirmation explaining that the secondary key will be permanently revoked and cannot be recreated, with No and Yes buttons — The confirmation identifies the key that will be permanently revoked.

Revocation removes the key permanently. If your account instead offers the older management controls, **Remove secondary key** deletes the secondary key and **Regenerate primary key** invalidates the old primary value while creating a replacement. Once all consumers use Secret Keys, remove the unused secondary key and regenerate the unused primary key to invalidate its old value. A new, unused project key remains in that case. If you require permanent removal and **Revoke** is unavailable, contact your Voiceflow support contact. If management controls are missing because of your access, ask someone with permission to update the project's API keys.

After all legacy keys are removed, the **API keys** settings item may disappear. Your personal and service keys remain managed in the workspace dashboard's settings.

### 3. Verify the deployed integrations again

Repeat each consumer's functional check after retiring the old keys. Confirm that requests still succeed with the intended project and Environment and that no application, CI secret or explicit CLI token still uses a retired value. The migration is complete when every consumer runs on a Secret Key and the original project-key values have been revoked or invalidated. Record any unused replacement project key that remains under the older controls.

## Recovery and legacy rotation

**Warning:** 
Revoked project keys cannot be recreated. Regenerating a key also invalidates its previous value immediately. Before retiring a working project key, fix any endpoint, scope or deployment problem with the replacement and verify it again. After revocation, recover by correcting or replacing the Secret Key; restoring the old value in an application does not restore the credential.

<a id="rotate-project-keys" />

### Rotate a project key while you migrate

Use these controls only if your project still offers legacy key creation and regeneration.

Rotating a Project Key (Legacy) does not complete the move to Secret Keys. If your **API keys** page only offers **Revoke**, create a personal or service key above instead; a revoked project key cannot be replaced with another project key through those controls.

### 1. Create a secondary key

Open the project's **Settings → API keys**. In the primary key's **More** menu, choose **Create secondary key**. If a secondary key already exists, first identify its consumers; do not regenerate or remove a value that a running integration still uses.

### 2. Move consumers to the secondary key

Copy the secondary key, update each consumer that uses the primary key and deploy the change. Verify each integration before continuing. The existing primary key remains active during this cutover.

### 3. Promote the verified secondary key

Click **Promote** beside the secondary key and confirm **Yes**. This replaces the primary key with the secondary key and invalidates the former primary value. Verify the deployed integrations again, then continue the migration to Secret Keys.

For immediate replacement without overlap, **Regenerate primary key** or **Regenerate secondary key** removes that value and creates a new one as soon as you confirm. Every consumer using the old value must receive the new value before it can authenticate again. **Remove secondary key** deletes that secondary key without creating a replacement.

## Next steps

- [Authentication and key permissions](/docs/api-reference/authentication#permissions)
- [Replace personal and service keys](/docs/api-reference/authentication#rotate-or-replace-a-key)
- [Create Chat sessions](/docs/api-reference/v4interact/start-session-specific-environment)
- [Import Knowledge with the Platform Document API](/docs/api-reference/document/create-url-document)
