Skip to content
getgeolens.com

Refresh

POST
/auth/refresh/
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.

X-GeoLens-Auth-Mode
Any of:
string

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.

X-CSRF-Token
Any of:
string

Double-submit CSRF token, enforced only when the refresh cookie is what authenticates the call. Echo the value of the geolens_csrf cookie issued alongside the refresh cookie. Callers presenting a refresh token in the request body do not send it.

Media type application/json
Any of:
RefreshRequest
object
refresh_token
required
Refresh Token
string
<= 512 characters
Example generated
{
"refresh_token": "example"
}

Successful Response

Media type application/json
TokenResponse
object
access_token
required
Access Token

JWT access token for Authorization header

string
refresh_token
required
Any of:
string
token_type
Token Type
string
default: bearer
expires_in
required
Expires In

Seconds until the access token expires

integer
Example
{
"token_type": "bearer"
}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}