/gate/verify-sessionVerify 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.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| token * | string | The end user's access token to check. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_INVALID_CREDENTIALS | The session token provided for verification is invalid or does not exist. |
| 401 | K9O_SESSION_EXPIRED | The session being verified has expired or been revoked. |
| data * | any | The verdict. A bad token is a 200 with |
| 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 ( |
| projectId * | string | The token's audience: this project's id ( |
| expiresAt * | string <date-time> | When the token expires. |
| or: object | ||
| valid * | false | The token must not be accepted. |
| reason * | string | Why. Otherwise the error code from checking the token, such as |
| 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.verifySession({
token: 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImtleV9leGFtcGxlIn0.eyJzdWIiOiJldV9leGFtcGxlIn0.c2lnbmF0dXJl'
})Showing example in TypeScript
{
"token": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImtleV9leGFtcGxlIn0.eyJzdWIiOiJldV9leGFtcGxlIn0.c2lnbmF0dXJl"
}{
"data": {
"valid": true,
"claims": {
"subjectId": "string",
"projectId": "string",
"expiresAt": "string"
}
}
}