Skip to content
einvoicing.dev

API/Keys

Revoke an API key

DELETE/v1/keys/{key_id}· API key

Revokes a key immediately. It is marked, not deleted, so it still appears in GET /v1/keys with revoked_at set. Revoking a key that is already revoked succeeds and changes nothing. A key may revoke itself; the next request made with it is 401.

Request
curl -X DELETE https://api.einvoicing.dev/v1/keys/<key_id> \  -H "Authorization: Bearer $EINVOICING_API_KEY"

Parameters

NameInTypeDescription
key_idrequiredpathUlid

The key's id from GET /v1/keys. Never the secret.

Response

204

The key is revoked.

No body.

Errors

Every error is application/problem+json (RFC 9457). Branch on type, which is stable, never on title or detail.

StatusWhen
401

No key, or a key that is unknown or revoked. Problem type is unauthenticated.

/problems/unauthenticated

403

A test key cannot manage keys or billing. Use a live key. Problem type is live-key-required.

404

No such resource on this account. Problem type is not-found.

/problems/not-found

429

Too many requests in a short window. Slow down and retry after the number of seconds in Retry-After. Problem type is rate-limited.

/problems/rate-limited