/auth/sessions/revoke-allRevoke All Sessions
Ends every live session of the calling end user in this project, on every device, this one included.
Call it with the end user's own Gate access token, whose audience must be this project.
Answers { revokedCount }, the number of sessions ended.
Each ended session's next refresh is refused 401 K9O_SESSION_EXPIRED with context.reason: "revoked".
Access tokens already issued stay valid until they expire.
The project's accessTokenTtlMins sets how long that is.
When a session ends, one auth.session.ended record with reason: "revoke_all" is written to the project audit log.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_UNAUTHENTICATED | The caller is not signed in. |
| 403 | K9O_TRUST_ZONE_VIOLATION | The token is not an end user's; an operator uses /auth/users/{userId}/sessions/revoke-all. |
| 403 | K9O_PROJECT_SCOPE_MISMATCH | The token's project audience is not this project. |
| data * | object | How many sessions were ended. |
| revokedCount * | integer | How many live sessions were ended, on every device, the caller's own included. Their refresh tokens stop working at once; access tokens already issued stay valid until they expire. 0 when there were none. |
| meta * | any | Request metadata: cost, timing and the request and trace ids. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.revokeAllSessions()Showing example in TypeScript
{
"data": {
"revokedCount": 0
}
}