Aller au contenu

Revoke a session

DELETE
/sessions/{sessionId}
curl --request DELETE \
--url https://auth.timetonic.com/api/sessions/example \
--header 'Authorization: Bearer <token>'

Revoke one of the authenticated user’s sessions. Invalidates that session’s access token (next request) and its refresh-token chain. Revoking the current session is rejected with 409 — use the logout endpoint instead. A session owned by another user (or unknown) returns 404 with no existence leak.

sessionId
required
string

Session revoked

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"
}

Session not found (unknown, or owned by another user)

Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{
"success": false,
"error": "session_not_found",
"message": "Session not found."
}

Refused — this is the current session (use logout)

Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{
"success": false,
"error": "current_session",
"message": "Use the logout endpoint to end your current session."
}

Rate limit exceeded

Media typeapplication/json
object
success
boolean
error
string
message
string
retry_after
integer
Example
{
"success": false,
"error": "too_many_requests",
"message": "Too many requests",
"retry_after": 45
}