Skip to main content
PATCH
/
api-keys
/
{key_id}
Update API key
curl --request PATCH \
  --url https://api.spikelabs.com/v1/api-keys/{key_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "*"
  ]
}
'
{
  "id": "key_abc123",
  "object": "api_key",
  "name": "Production API Key",
  "key_prefix": "sk_live_",
  "scopes": [
    "*"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your secret key (starts with sk_) as a Bearer token.

Path Parameters

key_id
string
required

Body

application/json
name
string
Maximum string length: 100
scopes
enum<string>[]
Available options:
*,
read,
write,
conversations,
chat,
voice,
video

Response

API key updated

id
string
required

Unique identifier

Example:

"key_abc123"

object
enum<string>
required
Available options:
api_key
name
string
required

Display name for the key

Example:

"Production API Key"

key_prefix
string
required

First 8 characters of the key for identification

Example:

"sk_live_"

scopes
enum<string>[]
required

Permissions granted to this key

Available options:
*,
read,
write,
conversations,
chat,
voice,
video
created_at
string<date-time>
required
last_used_at
string<date-time> | null