Skip to main content
POST
/
api
/
auth
/
logout
Logout
curl --request POST \
  --url https://api.example.com/api/auth/logout \
  --header 'Authorization: <authorization>'
{
  "message": "<string>"
}
Logs out the authenticated user. This endpoint currently returns a success response. In a complete implementation, this would invalidate the refresh token.

Authentication

Authorization
string
required
Bearer token (access token) obtained from login.

Response

message
string
Success message confirming logout.

Error Responses

401 Unauthorized

Returned when:
  • No Authorization header is provided
  • Access token is invalid or expired
  • Token format is incorrect

Example Request

curl -X POST https://api.tresacontafy.com/api/auth/logout \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "message": "Logout exitoso"
}
After logout, the client should discard both the access token and refresh token. Although the refresh token is not currently invalidated on the server side, clients should not attempt to use it after logout.

Build docs developers (and LLMs) love