Suspend or reactivate an API key
Update the enabled status of an API key.
- Set
enabled: falseto suspend the key (temporarily disable it) - Set
enabled: trueto reactivate a suspended key - Under API-key authentication, the acting key may suspend or reactivate the owner's other keys only in the tenant it is pinned to; elsewhere the request is refused with 403.
Path Parameters
- Type: stringkey
Id requiredAPI key ID to update
Body
required
application/json
- Type: booleanenabledrequired
Set to true to enable, false to suspend
Responses
- application/json
- application/json
- application/json
- 403
Access denied - the caller is neither the key's owner nor an
api-keys:manageholder in the key's tenant, or an API key is acting on the owner's key in a tenant other than the one it is pinned to. - application/json
Request Example for patch/auth/api-keys/{keyId}/status
curl 'https://api.gpcn.com/v1/auth/api-keys/{keyId}/status' \
--request PATCH \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_SECRET_TOKEN' \
--data '{
"enabled": true
}'
{
"success": true,
"data": {
"id": "string",
"name": "string",
"prefix": "string",
"start": "string",
"enabled": true,
"createdAt": "2026-10-21T16:19:07.188Z",
"expiresAt": "2026-10-21T16:19:07.188Z",
"lastUsedAt": "2026-10-21T16:19:07.188Z",
"roleId": "123e4567-e89b-12d3-a456-426614174000",
"isInherited": true,
"roles": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "string",
"displayName": "string",
"sortOrder": 1
}
],
"entityId": "123e4567-e89b-12d3-a456-426614174000",
"rateLimitEnabled": true,
"rateLimitMax": 1,
"rateLimitWindow": 1,
"userId": "123e4567-e89b-12d3-a456-426614174000",
"userName": "string",
"userEmail": "hello@example.com"
}
}.png)