Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

Update an API key

curl
PINECONE_API_KEY_ID="62b0dbfe-3489-4b79-b850-34d911527c88"
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"

curl -X PATCH "https://api.pinecone.io/admin/api-keys/$PINECONE_API_KEY_ID" \
     -H "X-Pinecone-Api-Version: 2025-04" \
     -H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
     -d '{
           "name": "new-api-key-name",
           "roles": ["ProjectEditor"]
         }'
CLI
PINECONE_API_KEY_ID="62b0dbfe-3489-4b79-b850-34d911527c88"

# Target the organization that contains the API key.
pc target -o "example-org" 
# Update the API key name.
pc api-key update -i $PINECONE_API_KEY_ID -n "new-api-key-name"
curl
{
  "id": "62b0dbfe-3489-4b79-b850-34d911527c88",
  "name": "new-api-key-name",
  "project_id": "32c8235a-5220-4a80-a9f1-69c24109e6f2",
  "roles": [
    "ProjectEditor"
  ],
  "created_at": "2025-10-22T19:27:21.202955Z"
}
CLI
ATTRIBUTE     VALUE
Name          new-api-key-name
ID            62b0dbfe-3489-4b79-b850-34d911527c88
Project ID    32c8235a-5220-4a80-a9f1-69c24109e6f2
Roles         ProjectEditor
PATCH/admin/api-keys/{api_key_id}

Update an API key

2 parameters
  • X-Pinecone-Api-Versionstringheaderrequired

    Required date-based version header

  • api_key_idstringpathrequired

    API key ID

cURL
curl --request PATCH \
  --url https://api.pinecone.io/admin/api-keys/{api_key_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "devkey",
  "roles": [
    "ProjectEditor"
  ]
}'
201
{
  "key": {
    "id": "<string>",
    "name": "<string>",
    "project_id": "<string>",
    "roles": [
      "ProjectEditor"
    ]
  },
  "value": "<string>"
}
  • Authorization (header, string, required) — Bearer authentication header of the form Bearer <token>.
  • api_key_id (path, string, required) — API key ID
  • name (body, string) — A new name for the API key. The name must be 1-80 characters long. If omitted, the name will not be updated.
  • roles (body, string[]) — A new set of roles for the API key. Existing roles will be removed if not included. If this field is omitted, the roles will not be updated.
  • 201 — API key created successfully.
  • 400 — Bad request. The request body included invalid request parameters.
  • 401 — Unauthorized. Possible causes: Invalid API key.
  • 403 — Forbidden
  • 500 — Internal server error.
  • 4XX — Unexpected error on request.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu