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

# Statuts WhatsApp

> Publiez des statuts WhatsApp (texte, image, vidéo, audio) et planifiez leur diffusion.

Toutes les routes utilisent le header `x-api-key`.

***

## Publier un statut

`POST /v1/sessions/:sessionId/status/send`

Publie un statut WhatsApp immédiatement.

<Note>
  Une réponse avec `accepted: true` signifie que WhatsApp Web a accepté la
  publication. La diffusion effective peut prendre quelques secondes.
</Note>

<ParamField body="type" type="string" required>
  Type de statut : `text`, `image`, `video`, `audio`
</ParamField>

<ParamField body="text" type="string">
  Texte du statut (requis si `type: text`)
</ParamField>

<ParamField body="url" type="string">
  URL publique du média (requis si type ≠ `text`)
</ParamField>

<ParamField body="caption" type="string">
  Légende du média (image ou vidéo)
</ParamField>

<ParamField body="backgroundColor" type="string">
  Couleur de fond hex pour les statuts texte (ex : `#111B21`)
</ParamField>

<ParamField body="statusJidList" type="array">
  Liste de JIDs ciblés pour la diffusion
</ParamField>

<ParamField body="audience" type="string">
  `all_contacts` pour diffuser à tous vos contacts
</ParamField>

<CodeGroup>
  ```json Texte theme={null}
  {
    "type": "text",
    "text": "Annonce du jour : ouverture exceptionnelle à 19h.",
    "backgroundColor": "#111B21"
  }
  ```

  ```json Image theme={null}
  {
    "type": "image",
    "url": "https://example.com/status/promo.jpg",
    "caption": "Promo du jour",
    "statusJidList": ["22997000000@s.whatsapp.net"]
  }
  ```

  ```json Vidéo theme={null}
  {
    "type": "video",
    "url": "https://example.com/status/story.mp4",
    "caption": "Teaser produit"
  }
  ```

  ```json Audio theme={null}
  {
    "type": "audio",
    "url": "https://example.com/status/voice.mp3",
    "statusJidList": ["22997000000@s.whatsapp.net"]
  }
  ```
</CodeGroup>

```bash cURL theme={null}
curl -X POST https://api.waaconnect.com/v1/sessions/uuid-session-12/status/send \
  -H "x-api-key: wac_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"type": "text", "text": "Annonce du jour : ouverture exceptionnelle à 19h.", "backgroundColor": "#111B21"}'
```

```json Réponse 200 theme={null}
{
  "ok": true,
  "accepted": true,
  "validation": "payload_validated",
  "deliveryState": "accepted_by_whatsapp_web",
  "type": "image",
  "target": "status@broadcast",
  "recipientsCount": 1,
  "statusJidList": ["22997000000@s.whatsapp.net"],
  "messageId": "3EB0B430B438B4F26B29"
}
```

***

## Programmer

`POST /v1/sessions/:sessionId/status/schedule`

Programme la publication d'un statut en one-shot après un délai.

<ParamField body="payload" type="object" required>
  Même structure que le corps de `/status/send`
</ParamField>

<ParamField body="delayMs" type="number" required>
  Délai avant publication en millisecondes
</ParamField>

```bash cURL theme={null}
curl -X POST https://api.waaconnect.com/v1/sessions/uuid-session-12/status/schedule \
  -H "x-api-key: wac_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {"type": "text", "text": "Status dans 5 minutes"},
    "delayMs": 300000
  }'
```

```json Réponse 200 theme={null}
{ "ok": true, "scheduledInMs": 300000 }
```

***

## Récurrent

`POST /v1/sessions/:sessionId/status/recurring`

Programme la publication automatique d'un statut à intervalles réguliers.

<ParamField body="payload" type="object" required>
  Même structure que le corps de `/status/send`
</ParamField>

<ParamField body="everyMs" type="number" required>
  Intervalle de répétition en millisecondes (ex : `86400000` pour 24h)
</ParamField>

```bash cURL theme={null}
curl -X POST https://api.waaconnect.com/v1/sessions/uuid-session-12/status/recurring \
  -H "x-api-key: wac_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {"type": "text", "text": "Rappel quotidien"},
    "everyMs": 86400000
  }'
```

```json Réponse 200 theme={null}
{
  "ok": true,
  "recurringEveryMs": 86400000,
  "timerId": "Timeout(12)"
}
```
