> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Revoke Api Keys V1

> Revoke up to 50 keys in one call (admin only). Self-protection: the calling key is never auto-revoked even if included in the list…

Revoke up to 50 keys in one call (admin only).

Self-protection: the calling key is never auto-revoked even if
included in the list. Use the singular `DELETE /keys/&#123;id&#125;` against
the same id from a different key if you really want it gone.

Per-row outcomes — unknown / cross-tenant ids surface as failures
without aborting the batch.

### Request body

`BulkRevokeKeysRequest`

<ParamField body="key_ids" type="string (uuid)[]" required>
  API key UUIDs to revoke (1..50). The calling key is NEVER auto-revoked — even if listed, it surfaces as `error: 'cannot revoke the calling key'`.
</ParamField>

### Response

`BulkRevokeKeysResponse`

<ResponseField name="revoked" type="integer" required />

<ResponseField name="skipped" type="integer" required />

<ResponseField name="rows" type="BulkRevokeKeyRow[]" required>
  <Expandable title="BulkRevokeKeyRow">
    <ResponseField name="key_id" type="string" required />

    <ResponseField name="revoked" type="boolean" required />

    <ResponseField name="error" type="string,null" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/keys/bulk-revoke' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "key_ids": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ]
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "revoked": 1,
    "skipped": 1,
    "rows": [
      {
        "key_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "revoked": false,
        "error": "string"
      }
    ]
  }
  ```
</ResponseExample>
