# Revoke a key

Refuses a key and its open tokens from the next request on, and keeps it in the list of revoked keys.

`DELETE /v1/keys/{id}` on `https://api.eu.vatis.tech`

> **Admin key only.** A Member key gets `403` `admin_only`. Roles: [Authentication and API keys](https://platform.vatis.tech/docs/authentication).

## Path parameters

| parameter | values | default | meaning |
|---|---|---|---|
| `id` | a key id, `key_...` | required | The key. |

## Headers

| header | values | default | meaning |
|---|---|---|---|
| `Authorization` | `Bearer <api key>` | required | An Admin key ([Roles](https://platform.vatis.tech/docs/authentication#roles)). A Member key gets `403` `admin_only`. |

## Responses

`204`: Revoked, also when it already was. The answer has no body.

`400` `invalid_parameter`: A query parameter: this endpoint takes none ([Strict parameters](https://platform.vatis.tech/docs/errors#strict-parameters)).

`401` `unauthorized`: No key, or a wrong, revoked or expired one.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid, revoked or expired key.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`403` `admin_only`: A Member key.

`404` `not_found`: No key of your workspace has that id.

`409` `last_admin`: The workspace's last active Admin key cannot be revoked from code: make another key Admin first.

```json
{
  "error": {
    "code": "last_admin",
    "message": "This is the last active Admin key: make another key Admin first.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`503` `unavailable`: The service is busy for a moment. Send the request again after the seconds of the `Retry-After` header.

## Notes

- What the key already started goes on: a live session already open runs until it ends, and a file already accepted is still transcribed.
- Nothing is deleted: Usage and Activity still name the key.
- The console's [API keys](https://platform.vatis.tech/keys) page can revoke any key, the last Admin key too: the console is the way back when no Admin key is left.
