# DELETE /v1/servers/{id}/tokens/{tokenId}

Revoke a key of a server

The key stops working at once. The last live key of a server cannot be revoked, so a server is never locked out; revoking a key that is already revoked is fine.

Takes an account key (`ak_…`) as a bearer token. TypeScript: `account.servers.tokens.revoke(serverId, tokenId)`. Python: `account.servers.tokens.revoke(server_id, token_id)`.

## Parameters

- `id` (path, required, string (uuid)): The server id.
- `tokenId` (path, required, string (uuid)): The key id.

## Responses

### 204 Removed. The body is empty.

## Errors

Every error answers `error`, the code, and `message`, a sentence for a person. A code that adds fields is shown in full below the table.

| Code | Status | Meaning |
| --- | --- | --- |
| `unauthorized` | 401 | The key is missing, malformed or revoked. |
| `wrong_token_kind` | 403 | The key is of the other kind: a server key (sk_) where an account key (ak_) is needed, or the reverse. The message names the kind the operation takes. |
| `not_found` | 404 | No such server of this account, or no such key of the server. |
| `last_token` | 409 | This is the only live key of the server; create another before revoking it. |
