Skip to main content
Rotating a credential replaces it with a new one while your applications keep running. Revoking a credential cuts off access, including for any application still using it. Rotate on a regular schedule and when someone with access leaves your team. Revoke right away if you think a key or secret has leaked.

Rotate an API key

API keys can’t be changed in place. To rotate one, create a replacement with the same permissions, switch your applications to it, and then delete the old key. Deleting last means your applications never lose access. Repeat these steps in each project that has keys to rotate. To find them all at once, list every API key in your organization.
  1. Open the Pinecone console and select your project.
  2. Go to API keys.
  3. Note the permissions of the key you’re replacing. To see them, in the key’s row, click ellipsis (…) menu > Settings.
  4. Click + API key, enter an API key name, and select the same Permissions as the key you’re replacing.
  5. Click Create key.
  6. Copy the new key and store it in a secure place.
    You cannot view the API key again after you close the dialog.
  7. Replace the old key with the new one everywhere it’s used, such as environment variables, secret managers, CI pipelines, and deployed applications. Then confirm your applications work with the new key.
  8. In the old key’s row, click ellipsis (…) menu > Delete.
  9. Enter the API key name and click Delete API key.

List every API key in your organization

In an organization with many projects, use the Admin API to find every key instead of checking each project in the console. This script lists the organization’s projects, then prints each key’s project, name, ID, roles, and creation time. It requires jq.
To complete this action through the Admin API, you need an access token.
Use an access token for a service account with the OrgOwner role, so the token can read the keys in every project.
curl
The output has one tab-separated line per key. To find keys created before a given date, sort or filter on the last column.
Output

Revoke an API key

To cut off an API key, delete it. Any application using the key starts getting 401 Unauthorized errors within seconds. If you can, create a replacement key first.
The console doesn’t let you delete a project’s last API key. Create the replacement key first, then delete the old one.

Rotate a service account secret

Service accounts are available on the Enterprise plan. Only organization owners can rotate a service account’s secret.
Rotating a service account’s secret issues a new client secret, and the old secret stops working right away. The client ID doesn’t change. Access tokens already issued with the old secret keep working until they expire, as shown in the token response’s expires_in field. Applications can’t request new access tokens until you give them the new secret, so have every place the secret is used ready to update before you start.
  1. Go to Settings > Access > Service accounts.
  2. In the service account’s row, click ellipsis (…) menu > Rotate secret.
  3. Enter the service account name to confirm, and click Rotate secret.
  4. Copy the new Client secret and store it in a secure place.
    You cannot view the client secret again after you close the dialog.
  5. Click Copy and Continue.
  6. Replace the old secret with the new one everywhere the service account is used. Keep the same client ID.
For how rotate_trigger works and how Terraform stores the secret, see Service accounts in the Terraform guide.

Revoke a service account

To cut off a service account, choose one of these options:
  • Rotate and discard: Rotate its secret and don’t store the new one. No one can request new access tokens, but tokens already issued keep working until they expire. The account and its role assignments stay in place, so you can restore access later by rotating again.
  • Delete: Delete the service account. Its access tokens stop working right away, and it’s removed from every project. You can’t undo it.

If a key or secret stops working

A request that returns 401 Unauthorized usually means the API key was deleted or the service account’s secret was rotated. Requests with that credential won’t work again, so get a new one: