Suspend or reactivate an API key

​

Update the enabled status of an API key.

  • Set enabled: false to suspend the key (temporarily disable it)
  • Set enabled: true to 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

  • API key ID to update

Body

required
application/json
  • Set to true to enable, false to suspend

Responses

  • application/json
  • application/json
  • application/json
  • Access denied - the caller is neither the key's owner nor an api-keys:manage holder 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"
  }
}