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

# Webhooks

> Eventos por HTTP POST, por sessão, com cabeçalho próprio.

Cada sessão tem `config.webhooks`, como no WAHA:

```json theme={null}
{
  "config": {
    "webhooks": [{
      "url": "https://seu-app.exemplo/waha-webhook",
      "events": ["message.any", "message.ack", "session.status"],
      "customHeaders": [{ "name": "X-Webhook-Token", "value": "segredo" }]
    }]
  }
}
```

Grave com `POST /api/sessions` (na criação) ou `PUT /api/sessions/{nome}`. O `PUT` **substitui** a config: leia antes e devolva o que não quer perder.

## Entrega

`POST` com `Content-Type: application/json` e os `customHeaders`. Até 3 tentativas, 2 s entre elas. Responda `2xx`.

```json theme={null}
{ "event": "message.any", "session": "suporte", "payload": { "id": "false_5511...@c.us_3EB0...", "from": "5511...@c.us", "to": "5519...@c.us", "fromMe": false, "body": "oi", "hasMedia": false, "timestamp": 1760000000 } }
```

## Eventos

| Evento | Quando | Campos principais |
| - | - | - |
| `message.any` | mensagem recebida ou enviada | `id`, `from`, `to`, `fromMe`, `body`, `hasMedia`, `timestamp`, `media` |
| `message.ack` | entregue, lida, ouvida | `id`, `ack` (1 enviada, 2 entregue, 3 lida, 4 ouvida) |
| `message.reaction`, `message.edited`, `message.revoked` | reação, edição, apagada | |
| `session.status` | status da sessão mudou | `name`, `status`, `me` |
| `label.upsert` `label.deleted` `label.chat.added` `label.chat.deleted` | etiquetas do WhatsApp Business | |
| `chat.state`, `group.update` | conversa fixada/arquivada/silenciada; grupo mudou | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.