Skip to main content

POST /api/logout

Revokes the current authentication token, effectively logging out the user. After logout, the token can no longer be used for authenticated requests.
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Authentication

This endpoint requires a valid authentication token obtained from the register or login endpoints. Include the token in the Authorization header:
Authorization: Bearer {token}

Request body

This endpoint does not require a request body.

Response

message
string
Confirmation message indicating successful logout.

Error responses

401 Unauthorized - Authentication failed. Common causes:
  • No token provided in Authorization header
  • Invalid or expired token
  • Token has already been revoked

Example request

curl -X POST https://api.filebright.com/api/logout \
  -H "Authorization: Bearer 1|AbCdEfGhIjKlMnOpQrStUvWxYz1234567890" \
  -H "Content-Type: application/json"

Example response

200 OK
{
  "message": "Logged out successfully"
}
401 Unauthorized
{
  "message": "Unauthenticated."
}
After logout, you’ll need to obtain a new token by calling the login endpoint to make authenticated requests again.

Build docs developers (and LLMs) love