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

Permissions: Requires either api-keys:self (for own keys) or api-keys:manage (for keys of users in scope). The service verifies specific access.

Path Parameters
  • keyId
    Type: string
    required

    API key ID to update

Body
required
application/json
  • enabled
    Type: boolean
    required

    Set to true to enable, false to suspend

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • 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-05-19T14:02:02.487Z",
    "expiresAt": "2026-05-19T14:02:02.487Z",
    "lastUsedAt": "2026-05-19T14:02:02.487Z",
    "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"
  }
}