Skip to main content
PATCH
/
org
/
api_keys
/
{id}
Update an API key
curl --request PATCH \
  --url https://api.onkernel.com/org/api_keys/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "new-api-name"
}
'
{
  "id": "ckv9w8q2f000001l5r3j7k9m4",
  "name": "production",
  "created_at": "2023-11-07T05:31:56Z",
  "created_by": {
    "id": "user-abc123",
    "email": "user@example.com",
    "name": "Jane Doe"
  },
  "expires_at": "2023-11-07T05:31:56Z",
  "project_id": "proj_abc123",
  "project_name": "Production",
  "masked_key": "sk_1234...abcd"
}

Documentation Index

Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-docs-chrome-policy-on-demand.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

API key ID

Body

application/json
name
string
required

New API key name

Required string length: 1 - 255
Example:

"new-api-name"

Response

API key updated

id
string
required

Unique API key identifier

Example:

"ckv9w8q2f000001l5r3j7k9m4"

name
string
required

API key name

Example:

"production"

created_at
string<date-time>
required

When the API key was created

created_by
object
required
expires_at
string<date-time> | null
required

When the API key expires

project_id
string | null
required

Project identifier for project-scoped API keys. Null means org-wide.

Example:

"proj_abc123"

project_name
string | null
required

Project name for project-scoped API keys. Null means the key is org-wide or the project name is unavailable.

Example:

"Production"

masked_key
string
required

Masked version of the API key

Example:

"sk_1234...abcd"