Refresh Access Token
POST
/auth/refresh
const url = 'http://localhost:8000/auth/refresh';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"refresh_token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/auth/refresh \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Exchange a valid refresh token for a fresh access token.
The supplied token must carry type == "refresh" — access tokens cannot
be replayed here. A new refresh token is also issued (sliding session).
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
RefreshRequest
object
refresh_token
required
Refresh Token
string
Examplegenerated
{ "refresh_token": "example"}Responses
Section titled “Responses”Successful Response
Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}