DocsAPI ReferenceUpdate an API key
PATCH
/api/v1/api-keys/{key_id}Updates the `name` or `expires_at` for an API key. The secret itself cannot be changed — revoke and recreate if you need a new secret.
Path Parameters
key_idintegerrequirede.g. 42Key integer ID.
Headers
X-API-KeystringrequiredYour workspace API key.
Content-TypestringrequiredMust be `application/json`.
Request Body
application/json
namestringNew label.
Example: "Staging Key"
expires_atstringNew expiry. Set to `null` to remove expiry.
Example: "2028-01-01T00:00:00Z"
Responses
200Updated key metadata.
404Key not found in this workspace.
Try it live
API Configurationglobal · all endpoints
PATCH
https://api.serveka.com/api/v1/api-keys/42Path Parameters
Request Body
curl -X PATCH 'https://api.serveka.com/api/v1/api-keys/42' \
-H "Content-Type: application/json"\
-d '{
"name": "Staging Key",
"expires_at": "2028-01-01T00:00:00Z"
}'