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

# Revoke a key

> Withdraw one of the Tenancy's API keys. The holder's next request is refused.

The revocation takes effect at once: it is read on every verification, never cached.

Nothing is deleted. The revocation is recorded beside the issuance and both stay readable. Rotation is a mint and then a revocation.

A revocation is irreversible, and a key is revoked once.

## Who may call

An administrator of the organization, as a person. The agent is refused on live and sandbox Tenancies alike.

## Path parameters

**tenant\_id** `string` *required*

The Tenancy acting. It comes from [Read the tenancy](https://docs.capcells.com/api-reference/console/tenancy/read.md); your organization must be bound to it.

**fingerprint** `string` *required*

The key's public half, as the listing reports it: 43 characters of base64url.

## Body

**reason** `string` *required*

Why the key is being withdrawn. It is recorded beside the fact.

## Response

Answers `201`.

**fingerprint** `string` *required*

The key revoked.

**reason** `string` *required*

The reason given.

**revoked\_by** `string` *required*

Who performed it.

**occurred\_on** `string` *required*

The civil date of the revocation: the day it was recorded.

## Refusals

| Status | Code | When |
| - | - | - |
| `401` | `unauthenticated` | The token is missing or cannot be used |
| `403` | `not_permitted_tenant` | Your organization does not act for the Tenancy in the path |
| `403` | `not_permitted_role` | The caller is not an administrator |
| `403` | `not_permitted_actor` | The caller is the agent |
| `400` | `malformed_request` | The body has an unknown field, a field stated twice, or more than one JSON value |
| `415` | `unsupported_media_type` | The body is not declared `application/json` |
| `404` | `no_credential` | No key of this Tenancy carries that fingerprint. Another Tenancy's key answers the same |
| `409` | | The key is already revoked; the first revocation stands |
| `422` | | No reason was stated |

Every refusal carries the [error shape](https://docs.capcells.com/api-reference/overview.md#the-error-shape). `429` and `503` answer as at the signing door.

```bash Request theme={null}
curl -X POST https://api.capcells.com/console/v1/tenants/capyplazo/keys/pfp1z8QkV2m9xL0aR7tCwYb3nH5jK8dF1gS4uE6oPqZ/revocation \
  -H "Authorization: Bearer $CONSOLE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"reason": "it appeared in a support ticket"}'
```

```json 404 theme={null}
{
  "error": "no credential of this tenant carries that fingerprint",
  "code": "no_credential"
}
```


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