Refresh
POST
/auth/refresh/
const url = 'https://example.com/api/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 https://example.com/api/auth/refresh/ \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Exchange a valid refresh token for a new access + refresh token pair.
Request Body required
Section titled “Request Body required ” Media type application/json
RefreshRequest
object
refresh_token
required
Refresh Token
string
Example generated
{ "refresh_token": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
TokenResponse
object
access_token
required
Access Token
JWT access token for Authorization header
string
refresh_token
required
Refresh Token
Opaque token used to obtain a new access token
string
token_type
Token Type
string
expires_in
required
Expires In
Seconds until the access token expires
integer
Example
{ "token_type": "bearer"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}