Skip to main content
PATCH
Update an API key

Authorizations

Authorization
string
header
required

Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.

Path Parameters

id
string
required

API key ID

Body

application/json
name
string
Required string length: 1 - 100
description
string | null
Maximum string length: 500
permissionMode
enum<string>

'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list.

Available options:
all,
readonly,
restricted
permissions
string[]

Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant.

bindings
object[]

Replaces the key's bindings outright. Whatever is accepted here is exactly what a subsequent GET returns.

Required array length: 1 - 20 elements

Response

The updated API key

id
string
name
string
description
string | null
keyType
enum<string>
Available options:
personal,
service
assignedToUserId
string | null

The member who owns the key; null for a service key.

createdByUserId
string | null
permissionMode
enum<string>
Available options:
all,
readonly,
restricted
permissions
string[]

The resource:action permissions a restricted key grants. Empty for the other modes.

createdAt
string<date-time>
expiresAt
string<date-time> | null
lastUsedAt
string<date-time> | null
revokedAt
string<date-time> | null
roleBindings
object[]
bindings
object[]