Refresh the access token
POST
/auth/refresh
const url = 'https://localhost:3000/api/v1/auth/refresh';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"refresh_token":"a1b2c3d4e5f6g7h8i9j0..."}'};
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://localhost:3000/api/v1/auth/refresh \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "a1b2c3d4e5f6g7h8i9j0..." }'Exchanges a refresh token for new tokens. Replaying the previous refresh token within the grace window (refresh_reuse_grace) only returns an access token, without refresh_token or cookie
Request Body
Section titled “Request Body”Refresh token
Media typeapplication/json
object
refresh_token
required
string
Example
a1b2c3d4e5f6g7h8i9j0...Responses
Section titled “Responses”Tokens refreshed
Media typeapplication/json
object
access_token
required
string
expires_in
required
integer
refresh_token
string
Example
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_in": 900, "refresh_token": "a1b2c3d4e5f6g7h8i9j0..."}Invalid request
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Invalid or expired refresh token
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Erreur interne
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}