Refresh
const url = 'https://example.com/auth/refresh/';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"refresh_token":"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://example.com/auth/refresh/ \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Exchange a valid refresh token for a new access + refresh token pair.
Multi-tenant clients must call this endpoint on their tenant host. Refresh
tokens are opaque and carry no bearer tid claim, so tenant middleware
binds the database transaction from that same-origin host before the user
row is resolved and the next tenant-bound access token is minted.
GH-1302: with X-GeoLens-Auth-Mode: cookie the presented token is read
from the httpOnly cookie (falling back to the body once, so a session
established before the cookie flow shipped migrates on its next refresh
instead of being logged out), the double-submit CSRF token is enforced, and
the rotated token goes back out as a cookie with a null body
refresh_token. Without the header this endpoint behaves exactly as
before.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Browser session-transport negotiation. Send cookie to carry the refresh token in an httpOnly geolens_refresh cookie, paired with a script-readable geolens_csrf cookie, and receive a null refresh_token in the response body. When the header is absent (the default) the refresh token is returned in the response body, which is the contract every non-browser caller uses.
Request Body
Section titled “Request Body ”object
Example generated
{ "refresh_token": "example"}Responses
Section titled “ Responses ”Successful Response
Bad request — invalid query parameters or payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks access to this resource
Not found
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request