Skip to main content

Refresh access token

Issues a new access token and refresh token. Accepts either a refresh token in the body or an access token in the Authorization header. Returns 401 if no token is provided or the token is expired/invalid.

Request​

Method: POST
Path: /api/users/refresh

Authentication: Not required

Request Body​

Content Type: application/json

Schema: See component schemas below

Responses​

200 - Tokens rotated​

401 - No or invalid token​

Examples​

cURL​

curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
http://localhost:3000/api/users/refresh \
-d '{"example": "data"}'

JavaScript​

const response = await fetch('http://localhost:3000/api/users/refresh', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token,
},
body: JSON.stringify({
// Request data
}),
});

const data = await response.json();
console.log(data);

This documentation is automatically generated from the OpenAPI specification.