Logout
const url = 'https://example.com/auth/logout/';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/auth/logout/ \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Revoke all refresh tokens and bump token_version for the current user.
Logout invalidates the access JWT used for this call and all other active browser sessions.
API keys remain valid because they are independent of browser sessions. Password and role changes still revoke them.
A refresh cookie can authenticate logout after the access token expires. Cookie-authenticated requests require CSRF validation.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “ Header Parameters ”Request Body
Section titled “ Request Body ”object
Example generated
{ "refresh_token": "example"}Responses
Section titled “ Responses ”Successful Response
Bad request — invalid query parameters or payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks access to this resource
Not found
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request