Managing your active sessions
Sessions & devicesA user reviews where they're signed in and revokes sessions. Counterpart to trusted-device management (scenario 22) — this lists where you are signed IN, that lists what is TRUSTED.
- GET /v1/me/sessions — active sessions (the current one has current: true)
- DELETE /v1/me/sessions/{sessionId} — revoke a specific session (e.g. a lost device)
- POST /v1/auth/logout — sign out the current session · POST /v1/auth/logout/all — everywhere
/v1/me/sessionsauthList my sessionsThe current session has current: true — use it to avoid revoking the device you're on by accident.
Field guide — what each value means & where it comes fromno inputs
No request body, no path/query params, and no caller-set headers. It only needs the tester's bearer access token plus the gateway-injected x-gateway-context (both handled for you); a missing/invalid context returns 403. Returns the list of your active sessions with the current one flagged.
GET https://api.kerja.team/v1/me/sessionsResponse guide — what comes back & what each value means8 fields
200 OK with the standard { data } envelope, where data is an ARRAY of the caller's active session objects (each item documented below via "data[]." paths). No special response headers. An empty array is returned if there are no active sessions.
data[].idstringalwaysdata[].ipstringalwaysdata[].userAgentstringalwaysdata[].amrarrayalwaysdata[].amr[]enumalwayspwd— Session was authenticated with a password (primary credential).otp— Session was authenticated with a one-time password / TOTP (MFA factor).
data[].createdAtISO-8601alwaysdata[].lastUsedAtISO-8601alwaysdata[].currentbooleanalwaystrue— This is the caller's own current session — do not offer/perform self-revocation by accident.false— A different session belonging to the user; safe to revoke remotely.
/v1/me/sessions/{sessionId}authRevoke one sessionRevoking a session does NOT untrust its device — sessions and device trust are separate lifetimes, so the next login from that browser still skips the device challenge. To stop that, untrust the device too (scenario 22).
Field guide — what each value means & where it comes from1 field
No request body. Revokes one of the caller's own sessions; the only caller-supplied input is the sessionId path param. Auth is still required (the tester supplies the access token and the gateway injects x-gateway-context identity).
sessionIdpathUUIDrequiredfrom a responseDELETE https://api.kerja.team/v1/me/sessions/{sessionId}Response guide — what comes back & what each value meansno body
200 OK returning the { data } envelope with an empty data object ({ "data": {} }) — no body fields and no notable response headers; signifies the named session was revoked.
/v1/auth/logoutauthLogout (current session)No body. Needs the sid the gateway puts in x-gateway-context. Clears the refresh_token cookie.
Field guide — what each value means & where it comes fromno inputs
No request body. Revokes the current session identified by the gateway context and clears the refresh_token cookie. The caller supplies no fields, path params, query params, or required headers — the tester sends the access token (Authorization) and the gateway injects x-gateway-context including the session id (sid). Returns 200 with { "data": {} }; fails 401 if there is no session id in the gateway context, or 403 if the gateway context is missing/invalid.
POST https://api.kerja.team/v1/auth/logoutResponse guide — what comes back & what each value meansno body
Returns 200 OK with the standard { data } envelope, where data is an empty object ({}) — there are no body properties to consume. The meaningful side effect is the Set-Cookie response header, which clears the refresh_token cookie (revoking the current session from the gateway context). The tester should treat this purely as a success/failure signal and drop any stored refresh token.
/v1/auth/logout/allauthLogout everywhereNo body. Revokes every session for the user and clears the refresh_token cookie. ONE SESSION COVERS EVERY APP, SO SIGNING OUT OF ONE SIGNS OUT OF ALL OF THEM (scenario 19): revoking the session kills every renewal chain under it — each open app fails its next POST /v1/auth/apps/{clientId}/refresh rotation, and any access token still in flight dies at its next /internal/validate hop or at expiry, whichever comes first. THERE IS NO PER-APP LOGOUT, and that is the same one-session model that makes the tenant switch (scenario 20) session-wide.
Field guide — what each value means & where it comes fromno inputs
No request body, path params, query params, or caller-set headers. It requires only an authenticated request: the tester sends the captured accessToken (Authorization) and the gateway injects x-gateway-context identifying the user; the endpoint revokes every session for that user and clears the refresh_token cookie. Returns 200 with an empty data object.
POST https://api.kerja.team/v1/auth/logout/allResponse guide — what comes back & what each value meansno body
Returns 200 OK with the { data } envelope, but data is an empty object ({ "data": {} }) — there are no body properties to consume. The notable side effect is the response header Set-Cookie clearing the refresh_token cookie (revoking every session for the authenticated user); the body itself carries no data.