Refresh access token
Auth & sessions
Refresh access token
Use a refresh token to get a new access token.
POST
Refresh access token
Use this when an
Response —
access_token has expired and the refresh_token is still valid. The SDK does this automatically after a 401.
Body
The refresh token returned by
/auth/token-exchange.Response — 200
Fresh 24h JWT.
May be rotated. Store the value returned by the response.
Always
"bearer".Lifetime of the new access token in seconds.
Example
When refresh fails
If the refresh token is expired (more than 7 days old) or revoked,/auth/refresh returns 401. At that point, call /auth/token-exchange with the original API key. If the API key is also gone, ask the user or service to authenticate again.
After 401
Without the SDK, implement this sequence in your HTTP client. With the SDK,AuthenticationError usually means refresh and exchange both failed.
