Refreshing an expiring session
Sessions & devicesAccess tokens are short-lived (default 600s). The client trades the refresh token for a new pair before/after expiry. One channel only: cookie clients get a rotated Set-Cookie, body clients get it in the body.
- POST /v1/auth/refresh → new accessToken (refresh token rotated)
/v1/auth/refreshpublicRefresh tokensCookie clients: the refresh_token cookie set at login rides along automatically — send {}. Body clients: put { refreshToken } in the body. The new accessToken is auto-captured. REUSE DETECTION: replaying an already-used refresh token revokes the ENTIRE session (401) — the expected signal of a stolen/duplicated token. If the session's membership became inactive → 403. Refresh NEVER triggers a device challenge: it is a re-mint of an existing authentication, not a new one, and the device decision is structurally unreachable from this path (the same holds for switch-tenant). This route answers 404 wherever MULTI_APP_ENABLED is on — leaving it reachable would leave a second, UNSCOPED way to renew beside the scoped per-app one (scenario 19).
Field guide — what each value means & where it comes from1 field
Rotates the refresh token and mints a new access token on a single channel (AUTH-IAM-02). Cookie clients send the refresh_token cookie (auto-relayed by the proxy) and get a rotated Set-Cookie with nothing in the body; non-cookie/body clients omit the cookie and instead supply refreshToken in the body and receive the rotated token back. No Authorization header is needed — this endpoint bears the refresh token itself.
refreshTokenbodystringconditionalfrom a responsePOST https://api.kerja.team/v1/auth/refreshResponse guide — what comes back & what each value means4 fields
200 OK with the standard { data } envelope; Cache-Control: no-store. On the cookie channel the rotated refresh token is delivered via Set-Cookie: refresh_token and is NOT echoed in the body; on the body channel (no cookie) the rotated refreshToken is returned in data. data always carries the new accessToken, tokenType, and expiresIn.
data.accessTokenJWTalwaysdata.tokenTypeenumalwaysBearer— Send the access token as 'Authorization: Bearer <accessToken>'.
data.expiresInintegeralwaysdata.refreshTokenstringconditional