Rotate the session's tokens.
const url = 'https://example.com/api/auth/v1/sessions/refresh';const options = {method: 'POST', headers: {cookie: 'refresh_token=<refresh_token>'}};
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/api/auth/v1/sessions/refresh \ --cookie refresh_token=<refresh_token>Takes the refresh_token cookie and sets new access_token and refresh_token cookies. A refresh token works once: presenting one that was rotated already ends the session. A 401 clears both cookies.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Refreshed.
object
object
When the session ends unless refreshed.
Example generated
{ "session": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "expires_at": "2026-04-15T12:00:00Z" }}Headers
Section titled “Headers”Access_token (HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=900) and refresh_token (HttpOnly; Secure; SameSite=Strict; Path=REFRESH_COOKIE_PATH; Max-Age=2592000), or both cleared.
No refresh cookie, or one that is unknown, expired or reused. Both cookies are cleared.
An RFC 9457 problem.
object
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Headers
Section titled “Headers”Access_token (HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=900) and refresh_token (HttpOnly; Secure; SameSite=Strict; Path=REFRESH_COOKIE_PATH; Max-Age=2592000), or both cleared.
The token lacks a scope or isn’t the right kind, or the request came from another origin.
An RFC 9457 problem.
object
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The service failed; the problem says nothing more.
An RFC 9457 problem.
object
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}