Skip to content

Refresh Token

POST /auth/refresh

A reused token revokes the whole family and returns the same 401 as an unknown one.

The body became optional so a browser can send nothing at all and let the cookie speak. refresh_token is still required inside the body, so a machine client that opens one still has to fill it in and min_length=16 still applies; what widened in the generated SDKs is only the body argument, from required to optional, which no existing call stops typechecking against.

A refusal erases the cookie, but only if one was presented. The family is gone — by expiry, by logout or by the replay detector — and a browser that keeps re-offering a dead credential turns every page load into a pointless round trip. Machine callers get no Set-Cookie on the way out because they sent none on the way in.

NameInTypeNotes
__Host-agentplat_refreshcookiestring | nulloptionalThe refresh credential, as the HttpOnly cookie this endpoint and /auth/login set. Browsers send it automatically; cross-origin callers need credentials: 'include'. Ignored when the body carries a token.
StatusDescriptionBody
200Successful ResponseTokenPair
422Validation ErrorHTTPValidationError

The body shows the fields the schema always carries. Which combination is legal is a service rule the schema cannot express, so read the description above before copying this.

Terminal window
curl -X POST https://your-deployment.example.com/auth/refresh \
-H "Content-Type: application/json" \
-d '{
"refresh_token": "string"
}'
FieldTypeNotes
access_tokenstringrequired—
refresh_tokenstringrequired—
token_typestringoptionalDefault "bearer".
expires_inintegerrequired—
principalPrincipalViewrequired—