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

# Quickstart

> Send your first message and receive your first event.

## 1. Send a message

```bash theme={null}
curl -X POST https://api.zapfy.io/v1/messages/send-text \
  -H "Authorization: Bearer zpfy_inst_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "5511999998888",
    "text": "Hello from Zapfy!"
  }'
```

The response confirms WhatsApp **accepted** the message (✓ sent). Delivery (✓✓) and
read come asynchronously via the [`MESSAGE_STATUS`](/en/webhooks/events#message-status)
webhook.

## 2. Register a webhook

In the dashboard, open the instance → **Settings** → **Webhooks**, enter the
destination URL and pick the events you want. You can have **up to 5 webhooks per
instance**, each subscribing to its own set of events.

## 3. Receive events

Zapfy sends a `POST` to your URL with the [canonical envelope](/en/webhooks/events#envelope):

```json theme={null}
{
  "event": "MESSAGE_RECEIVED",
  "instanceId": "01J9Z...",
  "id": "evt_01J9Z...",
  "timestamp": "2026-06-09T12:34:56.789Z",
  "data": {
    "messageId": "3EB0C767D...",
    "fromMe": false,
    "chat": {
      "jid": "5511999998888@s.whatsapp.net",
      "phone": "5511999998888",
      "isGroup": false,
      "name": null
    },
    "sender": {
      "jid": "5511999998888@s.whatsapp.net",
      "phone": "5511999998888",
      "name": "John Doe"
    },
    "type": "TEXT",
    "text": "Hi!"
  }
}
```

Reply `2xx` to acknowledge receipt. On failure, Zapfy retries the event — use the
`id` field as an **idempotency key** so you don't process duplicates.
