Skip to main content

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.

This surface sets no cookie

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​

FieldTypeRequiredDescription
sessionstringyesThe session value POST /api/session/scoped handed back.

Example

{
"session": "..."
}

Responses​

200​

The credential is gone.

FieldTypeRequiredDescription
sessionstringyes
actingAsstringno
mintedBystring or nullno
revokedtrue (constant)yes
detailstringyes

Example

{
"session": "...",
"actingAs": "...",
"mintedBy": "...",
"revoked": true,
"detail": "..."
}

400​

BAD_REQUEST -- session is absent or empty.

401​

No live session, a DPoP proof that did not verify, or a certificate session whose certificate the key server now refuses.

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.

CERTIFICATE_REVOKED -- on a session established by certificate login, the key server re-checks the certificate that session was established with on its operations, and it is now named by revocation evidence (ADR 0115). detail is the key server's sentence. Every later operation of the session is refused the same way; log in with a different certificate.

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.

StatusMeaning
400BAD_REQUEST -- session is absent or empty.
401No live session, a DPoP proof that did not verify, or a certificate session whose certificate the key server now refuses. 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. CERTIFICATE_REVOKED -- on a session established by certificate login, the key server re-checks the certificate that session was established with on its operations, and it is now named by revocation evidence (ADR 0115). detail is the key server's sentence. Every later operation of the session is refused the same way; log in with a different certificate.
404SCOPED_CREDENTIAL_NOT_FOUND -- no live scoped credential has that id. It may have expired on its own, already been revoked, or never existed.