Skip to main content
POST
/
authentication
/
logout
curl -X POST https://api.sapfiai.com/authentication/logout \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"
{
  "type": "https://tools.ietf.org/html/rfc7235#section-3.1",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authorization token is missing or invalid"
}
Log out the current user and invalidate their tokens.

Authentication

Required: This endpoint requires authentication via Bearer token.
Authorization: Bearer {token}

Request Body

This endpoint does not require a request body. The user ID is automatically extracted from the authentication token.

Response

isSuccess
boolean
Indicates whether the logout was successful.
succeeded
boolean
Alias for isSuccess. Indicates whether the operation succeeded.
error
object
Error information if the operation failed.
errors
object[]
Array of error objects if the operation failed.

Error Responses

{
  "type": "https://tools.ietf.org/html/rfc7235#section-3.1",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authorization token is missing or invalid"
}
curl -X POST https://api.sapfiai.com/authentication/logout \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"
{
  "isSuccess": true,
  "succeeded": true,
  "error": {
    "code": "",
    "description": ""
  },
  "errors": []
}

Build docs developers (and LLMs) love