Logout
POST
/auth/logout
const url = 'https://auth.timetonic.com/api/auth/logout';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', '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://auth.timetonic.com/api/auth/logout \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Invalidate current session. Accepts a Bearer token OR a portal session cookie (OidcBearerOrSession middleware); CSRF header required for the session branch.
Authorizations
Section intitulée « Authorizations »Request Body
Section intitulée « Request Body »Media typeapplication/json
object
refresh_token
Refresh token to invalidate
string
Examplegenerated
{ "refresh_token": "example"}Responses
Section intitulée « Responses »Logout successful
Media typeapplication/json
object
success
boolean
message
string
Example
{ "success": true}Authentication required or failed
Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{ "success": false, "error": "unauthorized", "message": "Authentication required"}