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

# Delete API Key

> Permanently revoke an API key

**Self-hosted only.** Cloud keys are managed in the dashboard, not through the API.

Deletes a key by its ID. This is irreversible, and any service using that key loses access immediately. To block access temporarily instead, [update the key](https://docs.openinary.dev/api-reference/api-keys/update.md) with `"enabled": false`.

```bash theme={null}
curl -X DELETE https://media.example.com/api-keys/key_abc123 \
  -H "Authorization: Bearer <api_key>"
```

```
DELETE /api-keys/{keyId}
```

**Auth:** API Key or Session

## Parameters

| Field | In | Type | Notes |
| - | - | - | - |
| `keyId` | path | string | Required. ID of the key to delete, from [List API Keys](https://docs.openinary.dev/api-reference/api-keys/list.md) |

## Response

```json theme={null}
{
  "success": true,
  "message": "API key deleted successfully"
}
```

**Status codes:** `200` success · `401` unauthorized · `403` forbidden · `404` not found · `500` error

## Related

> [card] [List API Keys](https://docs.openinary.dev/api-reference/api-keys/list.md)
>
> Find the key ID before deleting.

> [card] [Update API Key](https://docs.openinary.dev/api-reference/api-keys/update.md)
>
> Disable a key temporarily.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.