Skip to main content

Endpoint

POST /api/auth/logout

Authentication

Required. Include the session token in the Authorization header. If no valid token is provided, this endpoint returns 401 Unauthorized.

Request Headers

Authorization
string
required
Bearer token obtained from /api/auth/login. Format: Bearer fn_sess_...

Response

success
boolean
required
Always true when logout succeeds

Error Responses

Status Codes

  • 200 OK - Session invalidated successfully
  • 401 Unauthorized - No valid authentication token provided

Examples

curl -X POST http://localhost:3742/api/auth/logout \
  -H "Authorization: Bearer fn_sess_..."

Behavior Notes

  • The session token is immediately invalidated and cannot be reused
  • If the token was already invalid or expired, the endpoint still returns 200 OK
  • After logout, you must call /api/auth/login again to get a new token
  • Logout does not affect other active sessions if you’re logged in from multiple clients

Build docs developers (and LLMs) love