Skip to main content
POST/gate/verify-session

Verify Session

Validates a Gate-issued end-user access JWT, confirming it is properly signed and within its TTL.

Because Gate JWTs are stateless bearer tokens, verification is a local signature check against the project JWKS; the JWT TTL is the revocation propagation bound.

Parameters
projectSlug *path

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

It is unique within the org.

Request body
token *string

The end user's access token to check.

Responses
HTTPK9O CodeDescription
200Success
401K9O_INVALID_CREDENTIALSThe session token provided for verification is invalid or does not exist.
401K9O_SESSION_EXPIREDThe session being verified has expired or been revoked.
Response body (200)
data *any

The verdict.

A bad token is a 200 with valid: false, not an error.

One of: object
valid *true

The token is genuine, unexpired, issued for this project, and its end user is active.

claims *object

What the token says.

subjectId *string

The token's subject: the end user's id (eu_...).

projectId *string

The token's audience: this project's id (proj_...).

expiresAt *string <date-time>

When the token expires.

or: object
valid *false

The token must not be accepted.

reason *string

Why. AUDIENCE_MISMATCH: the token was issued for another project. SUBJECT_NOT_ACTIVE: its end user is locked, deleted or gone.

Otherwise the error code from checking the token, such as K9O_INVALID_TOKEN or K9O_TOKEN_EXPIRED.

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.verifySession({
  token: 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImtleV9leGFtcGxlIn0.eyJzdWIiOiJldV9leGFtcGxlIn0.c2lnbmF0dXJl'
})

Showing example in TypeScript

Request example
{
  "token": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImtleV9leGFtcGxlIn0.eyJzdWIiOiJldV9leGFtcGxlIn0.c2lnbmF0dXJl"
}
Response example (200)
{
  "data": {
    "valid": true,
    "claims": {
      "subjectId": "string",
      "projectId": "string",
      "expiresAt": "string"
    }
  }
}

More in Sign-in & Sessions