Skip to content

Refresh Access Token

POST
/auth/refresh
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).

Media typeapplication/json
RefreshRequest
object
refresh_token
required
Refresh Token
string
Examplegenerated
{
"refresh_token": "example"
}

Successful Response

Media typeapplication/json
Token
object
access_token
required
Access Token
string
refresh_token
Any of:
string
token_type
required
Token Type
string
Examplegenerated
{
"access_token": "example",
"refresh_token": "example",
"token_type": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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"
}
]
}