POST /v1/auth/logout - Logout the current user and invalidate their authentication tokens. This endpoint provides secure session termination and prevents token reuse.
Terminates the current user session and invalidates authentication tokens. This endpoint ensures secure session cleanup and prevents token reuse.
Authorization string required
Bearer token for authentication (access token).
refresh_token string optional
Refresh token to invalidate. Providing this ensures complete session cleanup by invalidating both access and refresh tokens.
A Logout Response object containing confirmation of successful logout and timestamp.
message string
Confirmation message indicating successful logout.
logged_out_at string
ISO 8601 timestamp of when the logout occurred.
{
"message": "Successfully logged out",
"logged_out_at": "2025-10-31T14:05:00Z"
}- Bash
- Python
- JavaScript
curl -X POST "https://api.aitronos.com/v1/auth/logout" \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}'Response:
{
"message": "Successfully logged out",
"logged_out_at": "2025-10-31T14:05:00Z"
}