Skip to content
Last updated

POST /v1/auth/logout - Logout the current user and invalidate their authentication tokens. This endpoint provides secure session termination and prevents token reuse.

POSThttps://api.aitronos.com/v1/auth/logout

Terminates the current user session and invalidates authentication tokens. This endpoint ensures secure session cleanup and prevents token reuse.

Headers

Authorization string required

Bearer token for authentication (access token).

Request Body

refresh_token string optional

Refresh token to invalidate. Providing this ensures complete session cleanup by invalidating both access and refresh tokens.


Returns

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.


Response

{
  "message": "Successfully logged out",
  "logged_out_at": "2025-10-31T14:05:00Z"
}
Bash
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"
}