Skip to main content
POST
/
api
/
logout
cURL
curl --request POST \
  --url https://www.wassly.com/api/logout \
  --header 'Authorization: Bearer <token>' \
  --header 'apikey: <api-key>'
{
  "success": true,
  "message": "Logout Successfully",
  "data": []
}

Overview

This endpoint terminates the current user session and invalidates the authentication token. After a successful logout, the user will need to authenticate again to access protected resources.

Authentication

This endpoint requires API key authentication via the apikey header. Required Headers:
  • apikey: Your API key for authentication
  • Content-Type: application/json
  • Accept: application/json

Request Details

Method: POST Endpoint: {{baseUrl}}/api/logout Request Body: Not required

Expected Response

Upon successful logout, the API will return a confirmation response indicating that the session has been terminated and the authentication token has been invalidated.

Usage Notes

  • This endpoint should be called when a user explicitly logs out of the application
  • After logout, any subsequent requests using the same authentication token will fail
  • The {{token}} variable will no longer be valid after this operation
  • Best practice: Clear any stored authentication tokens from client-side storage after calling this endpoint

Error Scenarios

  • 401 Unauthorized: Invalid or missing API key
  • 403 Forbidden: API key does not have permission to perform this action
  • 500 Internal Server Error: Server-side error during logout process

Example Usage

POST {{baseUrl}}/api/logout
Headers:
  Content-Type: application/json
  Accept: application/json
  apikey: {{apikey}}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

apikey
string
header
required

Response

200 - application/json

OK

success
boolean
required
message
string
required
data
any[]
required