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

# WhatsApp Overview

> Rich messaging with high engagement rates

WhatsApp Business API enables high-engagement messaging with rich features like images, documents, interactive buttons, and more.

## When to Use WhatsApp

* **Customer support**: Rich media and quick replies
* **Marketing campaigns**: Higher open rates than SMS (90%+ vs 20%)
* **Order updates**: Detailed information with images and tracking
* **International messaging**: Often cheaper than SMS

## Basic WhatsApp Message

<CodeGroup>
  ```typescript TypeScript theme={null}
  const result = await zavu.messages.send({
    to: "+14155551234",
    text: "Hello from Zavu!",
    channel: "whatsapp",
  });
  ```

  ```python Python theme={null}
  result = zavu.messages.send(
      to="+14155551234",
      text="Hello from Zavu!",
      channel="whatsapp"
  )
  ```

  ```ruby Ruby theme={null}
  result = client.messages.send(
    to: "+14155551234",
    text: "Hello from Zavu!",
    channel: "whatsapp"
  )
  ```

  ```go Go theme={null}
  result, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
      To:      zavudev.String("+14155551234"),
      Text:    zavudev.String("Hello from Zavu!"),
      Channel: zavudev.String("whatsapp"),
  })
  ```

  ```php PHP theme={null}
  $result = $client->messages->send([
      'to' => '+14155551234',
      'text' => 'Hello from Zavu!',
      'channel' => 'whatsapp',
  ]);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.zavu.dev/v1/messages \
    -H "Authorization: Bearer $ZAVU_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "+14155551234",
      "text": "Hello from Zavu!",
      "channel": "whatsapp"
    }'
  ```
</CodeGroup>

## The 24-Hour Conversation Window

WhatsApp enforces a conversation window that determines what types of messages you can send:

```
User sends message → 24-hour window opens → Send any message type
                                          ↓
                     Window expires → Template messages only
```

| Message Type            | Within 24h | After 24h |
| ----------------------- | ---------- | --------- |
| Text (session)          | Yes        | No        |
| Media (session)         | Yes        | No        |
| Interactive (session)   | Yes        | No        |
| Template (pre-approved) | Yes        | Yes       |

<Warning>
  Sending a session message outside the 24-hour window will fail. Use templates for messages outside the window.
</Warning>

## Message Types

WhatsApp supports rich message formats beyond plain text:

### Session Messages (within 24h window)

| Type     | Use Case                   | Guide                                          |
| -------- | -------------------------- | ---------------------------------------------- |
| Text     | Simple messages            | [Text](/guides/whatsapp/messages/text)         |
| Image    | Product photos, receipts   | [Image](/guides/whatsapp/messages/image)       |
| Video    | Tutorials, promotions      | [Video](/guides/whatsapp/messages/video)       |
| Audio    | Voice notes, announcements | [Audio](/guides/whatsapp/messages/audio)       |
| Document | PDFs, invoices             | [Document](/guides/whatsapp/messages/document) |
| Sticker  | Engagement, branding       | [Sticker](/guides/whatsapp/messages/sticker)   |
| Location | Store location, delivery   | [Location](/guides/whatsapp/messages/location) |
| Contact  | Share contact info         | [Contact](/guides/whatsapp/messages/contact)   |
| Buttons  | Quick actions              | [Buttons](/guides/whatsapp/messages/buttons)   |
| List     | Multiple options           | [List](/guides/whatsapp/messages/list)         |
| Reaction | Acknowledge messages       | [Reaction](/guides/whatsapp/messages/reaction) |

### Template Messages (anytime)

Pre-approved messages that can be sent outside the 24-hour window. See [Templates Guide](/guides/whatsapp/templates/sending).

## Delivery Status

WhatsApp provides detailed delivery tracking:

| Status      | Description                |
| ----------- | -------------------------- |
| `queued`    | Message accepted by Zavu   |
| `sent`      | Sent to WhatsApp servers   |
| `delivered` | Delivered to user's device |
| `read`      | User opened the message    |
| `failed`    | Delivery failed            |

<Tip>
  WhatsApp is the only channel that provides "read" receipts, useful for tracking engagement.
</Tip>

## Quality Rating

Meta tracks your messaging quality. Maintain good standing by:

1. **Getting opt-in consent** before messaging
2. **Respecting user preferences** - stop messaging users who don't respond
3. **Sending relevant content** - avoid spam-like messages
4. **Responding promptly** - engage within the 24-hour window

<Warning>
  Low quality ratings can result in reduced messaging limits or account suspension.
</Warning>

## Common Errors

| Error                   | Cause                           | Solution                         |
| ----------------------- | ------------------------------- | -------------------------------- |
| `Outside 24h window`    | Session expired                 | Use a template message           |
| `Template not approved` | Template pending/rejected       | Wait for approval or fix issues  |
| `Invalid phone format`  | Wrong number format             | Use E.164 format (+country code) |
| `User not on WhatsApp`  | Recipient doesn't have WhatsApp | Fall back to SMS                 |
| `Rate limited`          | Too many messages too fast      | Slow down sending rate           |

## Next Steps

* [Text Messages](/guides/whatsapp/messages/text) - Basic text with formatting
* [Image Messages](/guides/whatsapp/messages/image) - Send photos and images
* [Buttons](/guides/whatsapp/messages/buttons) - Interactive quick replies
* [Templates](/guides/whatsapp/templates/sending) - Pre-approved messages for any time
