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

# Delete Session

> Completely remove a session

## Description

This endpoint completely removes a session from the system, including all its data, configurations and authentication. This action is irreversible. If you want to temporarily disconnect only, use the logout endpoint.

## URL Parameters

<ParamField path="session" type="string" required>
  Unique session ID to be removed
</ParamField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "message": "Session deleted successfully",
    "session": "my-session"
  }
  ```
</ResponseExample>

## Status Codes

* `200` - Session deleted successfully
* `400` - Invalid parameters
* `404` - Session not found

## Usage Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.wappfy.com.br/api/sessions/my-session
  ```

  ```javascript JavaScript theme={null}
  const session = 'my-session';
  const response = await fetch(`https://api.wappfy.com.br/api/sessions/${session}`, {
    method: 'DELETE'
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  session = 'my-session'
  response = requests.delete(f'https://api.wappfy.com.br/api/sessions/{session}')
  data = response.json()
  print(data)
  ```
</CodeGroup>


## OpenAPI

````yaml viewer-en.json delete /api/sessions/{session}
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Customizable Server
    variables:
      host:
        default: api.wappfy.com.br
        description: Server URL (e.g., api.wappfy.com.br or your-server.com)
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: Control WhatsApp sessions (accounts)
  - name: 🔑 Auth
    description: Authentication
  - name: 🆔 Profile
    description: Your profile information
  - name: 🖼️ Screenshot
    description: Get WhatsApp screenshot and display QR code
  - name: 📤 Chatting
    description: Conversation methods
  - name: 📢 Channels
    description: Channels (newsletters) methods
  - name: 🟢 Status
    description: Status (aka stories) methods
  - name: 💬 Chats
    description: Conversations methods
  - name: 👤 Contacts
    description: |-
      Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      E.g: `12312312310` OR `12312312310@c.us`<br>
  - name: 👥 Groups
    description: Groups methods.<br>
  - name: ✅ Presence
    description: Presence information
  - name: 📅 Events
    description: Event Message
  - name: 🏷️ Labels
    description: Labels - available only for WhatsApp Business accounts
  - name: 🔍 Observability
    description: Other methods
  - name: 🗄️ Storage
    description: Storage methods
externalDocs:
  description: Wappfy - WhatsApp API
  url: https://docs.wappfy.com.br/
paths:
  /api/sessions/{session}:
    delete:
      tags:
        - 🖥️ Sessions
      summary: Delete the session
      description: >-
        Delete the session with the given name. Stop and logout as well.
        Idempotent operation. The {session} parameter must be the session's
        instanceName.
      operationId: SessionsController_delete
      parameters:
        - name: session
          required: true
          in: path
          description: The session name (instanceName) you want to delete
          example: my-session
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - api_key: []
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````