POST /api/session/scoped/revoke
Kill a scoped credential before it expires.
Destroys a scoped credential by id and closes the key-server session beneath it.
A revocation that finds nothing answers 404, not 200: a revocation you believe
happened and did not is worse than an error you can see.
The 200 means "the credential no longer exists here", which is the part this Gateway
can guarantee. Releasing the key-server token is best effort at the session tier, and its
failure is counted rather than thrown.
Authentication
Send the session id as Authorization: Bearer <session id>, and an RFC 9449 DPoP proof in the DPoP header if your session is bound to a key. The two are required together, not as alternatives — see Authenticating and Proving you hold your key.
There is no session cookie on any response and none is read on any request. Do not set credentials: "include" on a browser fetch.
Request
| Field | Type | Required | Description |
|---|---|---|---|
session | string | yes | The session value POST /api/session/scoped handed back. |
Example
{
"session": "..."
}
Responses
200
The credential is gone.
| Field | Type | Required | Description |
|---|---|---|---|
session | string | yes | |
actingAs | string | no | |
mintedBy | string or null | no | |
revoked | true (constant) | yes | |
detail | string | yes |
Example
{
"session": "...",
"actingAs": "...",
"mintedBy": "...",
"revoked": true,
"detail": "..."
}
400
BAD_REQUEST -- session is absent or empty.
401
No live session, or a DPoP proof that did not verify.
SESSION_NOT_FOUND -- the credential names no session this Gateway holds.
SESSION_EXPIRED -- it aged out. Both carry reauth: true; obtain a new credential
rather than retrying.
PROOF_* -- the sender constraint refused. See the DPoP section of this document for the
full table; PROOF_MALFORMED is a 400 and PROOF_REPLAY_CACHE_FULL a 503, and the
rest are here.
SCOPED_CREDENTIAL_EXPIRED -- a scoped browser credential passed its fixed lifetime. Use
does not extend it: an idle timeout would be refreshed by exactly the traffic a stolen
handle produces.
404
SCOPED_CREDENTIAL_NOT_FOUND -- no live scoped credential has that id. It may have expired on its own, already been revoked, or never existed.
Error handling
Every failure answers JSON carrying at least code and detail. Match on code — detail is written for a human debugging the call and its wording is not part of the contract. See the error model.
| Status | Meaning |
|---|---|
400 | BAD_REQUEST -- session is absent or empty. |
401 | No live session, or a DPoP proof that did not verify. SESSION_NOT_FOUND -- the credential names no session this Gateway holds. SESSION_EXPIRED -- it aged out. Both carry reauth: true; obtain a new credential rather than retrying. PROOF_* -- the sender constraint refused. See the DPoP section of this document for the full table; PROOF_MALFORMED is a 400 and PROOF_REPLAY_CACHE_FULL a 503, and the rest are here. SCOPED_CREDENTIAL_EXPIRED -- a scoped browser credential passed its fixed lifetime. Use does not extend it: an idle timeout would be refreshed by exactly the traffic a stolen handle produces. |
404 | SCOPED_CREDENTIAL_NOT_FOUND -- no live scoped credential has that id. It may have expired on its own, already been revoked, or never existed. |