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

# Déconnecter un compte

> Déconnectez un compte WhatsApp de votre système

## Déconnecter un compte

Déconnectez un compte WhatsApp de votre système.

### Endpoint

<ParamField method="POST" path="/v1/whatsapp/disconnect" />

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token avec votre Secret Key (format: `Bearer sk_...`)
</ParamField>

### Body Parameters

<ParamField body="accountId" type="string" required>
  ID du compte à déconnecter
</ParamField>

### Exemples de requêtes

<CodeGroup>
  ```bash BASH theme={null}
  curl -X POST https://api.wachap.com/v1/whatsapp/disconnect \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer token" \
    -d '{
      "accountId": "account_abc123"
    }'
  ```

  ```javascript JAVASCRIPT theme={null}
  const response = await fetch('https://api.wachap.com/v1/whatsapp/disconnect', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer token',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      accountId: 'account_abc123'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

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

  url = "https://api.wachap.com/v1/whatsapp/disconnect"
  headers = {
      "Authorization": "Bearer token",
      "Content-Type": "application/json"
  }
  payload = {"accountId": "account_abc123"}

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/disconnect",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode(["accountId" => "account_abc123"]),
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer token",
      "Content-Type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);
  echo $response;
  ?>
  ```
</CodeGroup>

### Réponse succès

```json theme={null}
{
  "success": true,
  "message": "Compte déconnecté avec succès"
}
```

<Note>
  **Note**

  Une fois déconnecté, vous devrez reconnecter le compte via QR Code ou PIN pour l'utiliser à nouveau.
</Note>


## OpenAPI

````yaml POST /whatsapp/disconnect
openapi: 3.0.3
info:
  title: WaChap API
  version: 2.0.0
servers:
  - url: https://api.wachap.com/v1
    description: WaChap API server
security:
  - BearerAuth: []
tags:
  - name: Instances
    description: Créer et gérer des instances WhatsApp
  - name: Webhook
    description: Configuration des webhooks de réception
  - name: Messages
    description: Envoyer des messages WhatsApp
  - name: Comptes
    description: Gérer vos comptes WhatsApp connectés
  - name: SMS
    description: Service SMS de WaChap (V4) via FCM
  - name: Étiquettes WhatsApp
    description: Créer et associer des étiquettes aux conversations WhatsApp
paths:
  /whatsapp/disconnect:
    post:
      tags:
        - Comptes
      summary: Déconnecter un compte
      description: Déconnecter un compte WhatsApp de votre système.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: string
                  description: ID du compte à déconnecter
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '400':
          description: Bad Request
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````