Skip to main content
POST/auth/sessions/revoke-all

Revoke 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.

Parameters
projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
401K9O_UNAUTHENTICATEDThe caller is not signed in.
403K9O_TRUST_ZONE_VIOLATIONThe token is not an end user's; an operator uses /auth/users/{userId}/sessions/revoke-all.
403K9O_PROJECT_SCOPE_MISMATCHThe token's project audience is not this project.
Response body (200)
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.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.revokeAllSessions()

Showing example in TypeScript

Response example (200)
{
  "data": {
    "revokedCount": 0
  }
}

More in Sign-in & Sessions