POST /auth/api/revoke
Invalidate tokens. Either a single token (by jti) or every live
token for the client account.
Revoking a single token (jti) accepts an already-expired access
token, so a late logout still works. Omitting jti revokes every live
token for the account and requires a valid, unexpired access token.
Tokens issued before an API key rotation, or belonging to a deactivated
client, revoke nothing.
Use case
Suspected token leak: call with no body to kill everything, then re-issue via API key from a trusted host.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer <accessToken>. An expired token is accepted only together with a jti. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
jti | string | no | Specific token id to revoke. Omit to revoke all tokens for the caller. |
Response
204 No Content on success.
Errors
| Status | Meaning |
|---|---|
401 | Missing / malformed access token; token from before a key rotation (Token key version mismatch); or no jti given and the access token is expired. |
403 | The client API is inactive. |
404 | jti specified but not found for this client. |
429 | Per-IP limit on /auth/api/* exceeded (default 30 requests per minute per IP). Response body { "message": "…", "retryAfter": <seconds> } and a Retry-After header. |
Examples
Revoke everything (after a suspected leak; needs an unexpired token):
curl -X POST "$BASE_URL/auth/api/revoke" \
-H "Authorization: Bearer $ACCESS"
Revoke a single token by jti:
curl -X POST "$BASE_URL/auth/api/revoke" \
-H "Authorization: Bearer $ACCESS" \
-H "Content-Type: application/json" \
-d '{ "jti": "b2c3…" }'