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

# Revoke an API key

> Revoke a federated API key by its prefix. Other keys under the same group are unaffected.

Revoke a single federated API key by its `prefix`. Other keys under the same group are unaffected. Revocation is irreversible: the key can't authenticate any further request and can't be restored. To restore access for the same downstream customer, mint a new key under the same group with [Create an API key](/reference/gateway/api-keys/create-an-api-key).

### Authentication

<ParamField header="Authorization" type="string" required>
  Workspace API key with management scope, formatted as `Api-Key <your-key>`.
</ParamField>

### Path parameters

<ParamField path="group_id" type="string" required>
  Internal Baseten ID of the owning group.
</ParamField>

<ParamField path="api_key_prefix" type="string" required>
  The key's prefix.
</ParamField>

### Response

<ResponseField name="prefix" type="string" required>
  The prefix of the revoked key.
</ResponseField>

### Errors

| Status          | Meaning                                                                                           |
| --------------- | ------------------------------------------------------------------------------------------------- |
| `403 Forbidden` | The group or key exists but isn't in your workspace, or the caller doesn't have management scope. |
| `404 Not Found` | No group or key with these identifiers in your workspace, or the key has already been revoked.    |

<RequestExample>
  ```bash curl theme={"system"}
  curl --request DELETE \
    --url https://api.baseten.co/v1/gateway/groups/abc123hash/api_keys/aBcDeFg \
    --header "Authorization: Api-Key $BASETEN_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "prefix": "aBcDeFg"
  }
  ```
</ResponseExample>
