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

# Vérifier numéros WhatsApp

> Vérifiez si des numéros de téléphone sont enregistrés sur WhatsApp

### Endpoint

<ParamField method="POST" path="/v1/whatsapp/contacts/check" />

### 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>
  L'identifiant du compte WhatsApp
</ParamField>

<ParamField body="phones" type="array" required>
  Liste des numéros à vérifier (format international)
</ParamField>

### Notes

* Les numéros peuvent être au format international (+33...) ou local (33...)
* Le champ verifiedName n'apparaît que pour les comptes business vérifiés
* Cette vérification est utile avant d'envoyer des campagnes

### Exemples de requêtes

<CodeGroup>
  ```bash BASH theme={null}
  curl -X POST https://api.wachap.com/v1/whatsapp/contacts/check \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer token" \
    -d '{
      "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
      "phones": ["+2290112345678", "+33612345678", "2290112345678"]
    }'
  ```

  ```javascript JAVASCRIPT theme={null}
  const response = await fetch('https://api.wachap.com/v1/whatsapp/contacts/check', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer token',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      accountId: 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
      phones: ['+2290112345678', '+33612345678', '2290112345678']
    })
  });

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

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

  url = "https://api.wachap.com/v1/whatsapp/contacts/check"
  headers = {
      "Authorization": "Bearer token",
      "Content-Type": "application/json"
  }
  payload = {
      "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
      "phones": ["+2290112345678", "+33612345678", "2290112345678"]
  }

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

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

  $payload = [
      "accountId" => "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
      "phones" => ["+2290112345678", "+33612345678", "2290112345678"]
  ];

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

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

### Exemple de réponse

```json theme={null}
{
  "success": true,
  "total": 3,
  "onWhatsApp": 2,
  "message": "2/3 numéro(s) sur WhatsApp",
  "results": [
    {
      "phone": "+2290112345678",
      "isOnWhatsApp": true,
      "jid": "2290112345678@s.whatsapp.net",
      "verifiedName": "Official Name"
    },
    {
      "phone": "+33612345678",
      "isOnWhatsApp": false
    },
    {
      "phone": "2290112345678",
      "isOnWhatsApp": true,
      "jid": "2290112345678@s.whatsapp.net"
    }
  ]
}
```

### Codes d'erreur

| Code  | Description                                      |
| :---- | :----------------------------------------------- |
| `400` | MISSING\_ACCOUNT\_ID - accountId manquant        |
| `400` | MISSING\_PHONES - phones manquant ou vide        |
| `401` | INVALID\_SECRET\_KEY - Clé secrète invalide      |
| `404` | ACCOUNT\_NOT\_FOUND - Compte WhatsApp non trouvé |


## OpenAPI

````yaml POST /whatsapp/contacts/check
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/contacts/check:
    post:
      tags:
        - Contacts
      summary: Vérifier des numéros
      description: Vérifier si des numéros sont sur WhatsApp.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: string
                phones:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: OK
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````