Rotate a refresh token and issue a new access token.
const url = 'https://session-api.sudomimus.com/refresh';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"refreshToken":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://session-api.sudomimus.com/refresh \ --header 'Content-Type: application/json' \ --data '{ "refreshToken": "example" }'Rotates an ordinary application refresh token and returns a new access
token and refresh token. Replace the stored refresh token after every
success. A near-simultaneous retry may receive the already-issued
winning token pair. Reuse outside that allowance revokes the session;
restart through an initial issuance flow. OIDC sessions must use the
OIDC /token endpoint instead.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Signed refresh credential carrying stable payload sid, exact version jti, and rotationVersion; it contains no user identifier.
Examplegenerated
{ "refreshToken": "example"}Responses
Section titled “Responses”New access and refresh tokens issued. A near-simultaneous retry may receive the token pair already issued for the same rotation.
object
object
object
object
object
object
object
Newly issued short-lived access token JWT carrying payload sid and pairwise sub with a fresh jti.
Newly issued refresh token JWT for the same payload sid, with a fresh jti and incremented rotationVersion; the presented version has been consumed.
Example
{ "claims": { "email": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "firstName": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "lastName": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "staticAvatar": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" }, "animatedAvatar": { "requirement": "SYNTHETIC_ONLY", "state": "UNKNOWN" } }}Headers
Section titled “Headers”Prevent storage of the credential-bearing response.
Legacy cache instruction retained for credential responses.
Reason AccountNotFound — the account behind the refresh token could not be resolved.
Error response body. A missing, malformed, or structurally invalid JSON
request body returns InvalidBody. Documented status-only failures have
an empty response body.
object
Examplegenerated
{ "reason": "example", "message": "example"}Refresh token rejected. The reason distinguishes:
RefreshTokenInvalid— the token is malformed or does not match a valid application session.RefreshTokenInvalidType— the token type or issuance protocol is not accepted here.RefreshTokenInvalidSignature— signature verification failed.RefreshTokenSuspended— the session is suspended.RefreshTokenExpired— the token is past itsexp.RefreshTokenRevoked— the session is revoked.RefreshTokenFamilyCompromised— a stale token version was used; the session is now revoked.
Some unrecoverable rotation conflicts return an empty 401 body.
Error response body. A missing, malformed, or structurally invalid JSON
request body returns InvalidBody. Documented status-only failures have
an empty response body.
object
Examplegenerated
{ "reason": "example", "message": "example"}The attempt was refused. The reason distinguishes:
AccountDisabledorAccountDeleted— the account is unavailable for issuance.ApplicationNotActive— the application is unavailable.ClaimConsentRequiredorRequiredClaimDataMissing— current claim requirements are not satisfied.EmailDomainBlocked,EmailDomainRequiresSso, orSsoAuthorityConflict— email-domain policy prevents issuance.
Error response body. A missing, malformed, or structurally invalid JSON
request body returns InvalidBody. Documented status-only failures have
an empty response body.
object
Examplegenerated
{ "reason": "example", "message": "example"}Reason AuthorizationArtifactStale: identity authority changed
during refresh. Restart through an initial issuance flow.
Error response body. A missing, malformed, or structurally invalid JSON
request body returns InvalidBody. Documented status-only failures have
an empty response body.
object
Examplegenerated
{ "reason": "example", "message": "example"}default
Section titled “default”Error response.
Error response body. A missing, malformed, or structurally invalid JSON
request body returns InvalidBody. Documented status-only failures have
an empty response body.
object
Examplegenerated
{ "reason": "example", "message": "example"}