API: POST /v1/keys/revoke
purpose
Revoke only the API key you send. POST-only (GET /v1/keys/revoke returns 404 not_found). Unauthenticated calls return 401 key_required. A presented but unrecognized key returns 401 key_not_recognized.
call
# Live validation only (no real key is revoked):
curl -sS -X POST 'https://botsrated.com/v1/keys/revoke'
# Revokes only the key in the header. Do not run this against a key you still need:
# curl -sS -X POST 'https://botsrated.com/v1/keys/revoke' \
# -H 'Authorization: Bearer brf_…'
sample_response
source: live prod POST with no key returns 401 key_required; POST with an unrecognized Bearer brf_ string returns 401 key_not_recognized. Both charged: false. GET /v1/keys/revoke is 404 not_found. fetched: live production, 25 Nov 2026 (counts redacted) trimmed: true
{
"no_key": {
"beta": false,
"error": {
"code": "key_required",
"message": "Send your free API key as Authorization: Bearer brf_… or X-API-Key.",
"charged": false
}
},
"unrecognized_key": {
"beta": false,
"error": {
"code": "key_not_recognized",
"message": "That API key was not recognized. Check the key, or get a free one from POST /v1/keys/free.",
"charged": false
}
}
}
errors
| code | when | fix |
|---|---|---|
| key_required (live 401) | No Authorization or X-API-Key header. | Send the exact key you want to revoke as Authorization: Bearer or X-API-Key. A key id in the body is rejected. |
| key_not_recognized (live 401) | A key header is present but not recognized. | Check the key, or get a free one from POST /v1/keys/free. |
| 409 | The key still has prepaid credit or an active paid subscription. The key is not revoked, and the credit or Stripe subscription is not cancelled. | Use or move the credits first, or write to support@botsrated.com. |
| 410 | A second call on an already revoked key. | The key is already revoked; request a new key with POST /v1/keys/free if you need one. |
notes
Revoking a key deletes its usage limits, alert webhook URL, and spend / low-credit alert records for that key. Rate limits match GET /v1/keys/balance.