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

# Reconnecter

> Rétablit la connexion à WhatsApp Web.



## OpenAPI

````yaml /api/openapi.yaml get /reconnect
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:
  /reconnect:
    get:
      tags:
        - Instances
      summary: Reconnecter
      description: Rétablir la connexion à WhatsApp Web.
      parameters:
        - name: instance_id
          in: query
          required: true
          schema:
            type: string
          description: Identifiant de l'instance
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  success:
                    type: boolean
                  message:
                    type: string
              examples:
                default:
                  value:
                    status: 200
                    success: true
                    message: Instance reconnectée
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl
            "https://api.wachap.com/v1/reconnect?instance_id=609ACF283XXXX&access_token=646116c7XXXX"
        - lang: javascript
          label: JavaScript
          source: >
            const params = new URLSearchParams({ instance_id: '609ACF283XXXX',
            access_token: '646116c7XXXX' });

            const res = await
            fetch(`https://api.wachap.com/v1/reconnect?${params}`);

            console.log(await res.json());
        - lang: python
          label: Python
          source: >
            import requests

            params = { 'instance_id': '609ACF283XXXX', 'access_token':
            '646116c7XXXX' }

            r = requests.get('https://api.wachap.com/v1/reconnect',
            params=params)

            print(r.json())
        - lang: php
          label: PHP
          source: |
            <?php
            $params = http_build_query([
              'instance_id' => '609ACF283XXXX',
              'access_token' => '646116c7XXXX'
            ]);
            $url = 'https://api.wachap.com/v1/reconnect?' . $params;
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            curl_close($ch);
            echo $response;
            ?>
        - lang: go
          label: Go
          source: |
            package main
            import (
              "fmt"
              "net/http"
              "net/url"
              "io/ioutil"
            )
            func main() {
              params := url.Values{}
              params.Add("instance_id", "609ACF283XXXX")
              params.Add("access_token", "646116c7XXXX")
              resp, err := http.Get("https://api.wachap.com/v1/reconnect?" + params.Encode())
              if err != nil { panic(err) }
              defer resp.Body.Close()
              body, _ := ioutil.ReadAll(resp.Body)
              fmt.Println(string(body))
            }
        - lang: jsx
          label: React
          source: |
            async function reconnect() {
              const params = new URLSearchParams({ instance_id: '609ACF283XXXX', access_token: '646116c7XXXX' });
              const res = await fetch(`https://api.wachap.com/v1/reconnect?${params}`);
              console.log(await res.json());
            }
        - lang: typescript
          label: Next.js
          source: |
            // app/reconnect/page.js
            export default async function Page() {
              const params = new URLSearchParams({ instance_id: '609ACF283XXXX', access_token: '646116c7XXXX' });
              const res = await fetch(`https://api.wachap.com/v1/reconnect?${params}`, { cache: 'no-store' });
              const data = await res.json();
              return <pre>{JSON.stringify(data, null, 2)}</pre>;
            }
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Message d’erreur
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````