Skip to content

Refresh access token using a refresh token

POST
/api/v1/auth/refresh
Code sample: cURL
curl -X POST 'https://dashboard.justcrawl.io/api/v1/auth/refresh' \
-H 'Content-Type: application/json' \
-d '{"refreshToken":"<your-7-day-refresh-token>"}'

Exchanges a valid refresh token for a new access/refresh token pair. Refresh tokens are rotated on every use — the old token is invalidated atomically before the new one is issued, so accidentally reusing a prior refresh token returns 401. Refresh tokens live 7 days; access tokens live 15 minutes. Subject to a dedicated refreshLimiter rate bucket sized for normal refresh cadence — a tight loop hitting this endpoint returns 429.

Media type application/json
object
refreshToken
required
string
Example generated
{
"refreshToken": "example"
}

New access and refresh tokens issued.

Media type application/json
object
user

Echoed for client-side hydration after token rotation.

object
accessToken
string
refreshToken
string
Example generated
{
"user": {},
"accessToken": "example",
"refreshToken": "example"
}

Validation failed — request body or query is missing/invalid

Media type application/json
object
error
string
Example
{
"error": "Missing or invalid \"url\" field"
}

Missing or invalid authentication token

Media type application/json
object
error
string
Example
{
"error": "Missing or invalid authentication token"
}

Unexpected server error. Logs and PostHog $exception capture

Media type application/json
object
error
string
Example
{
"error": "Something went wrong"
}