> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wassly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Logout

## 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}}

```


## OpenAPI

````yaml POST /api/logout
openapi: 3.1.0
info:
  title: Wassly API Documentation
  version: 1.0.0
  description: Wassly API Documentation.
servers:
  - url: https://www.wassly.com
security: []
paths:
  /api/logout:
    post:
      tags:
        - Authentication
      operationId: Authentication_POST_api_logout_post_api_logout
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: array
                    items: {}
                required:
                  - success
                  - message
                  - data
              example:
                success: true
                message: Logout Successfully
                data: []
      security:
        - bearerAuth: []
          apiKeyAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````