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

# Easy Way

> The simplest way to send messages with Zavu

Send your first message in seconds. Zavu handles channel selection, delivery optimization, and fallbacks automatically.

## Quick Start

<CodeGroup>
  ```typescript TypeScript theme={null}
  import Zavudev from '@zavudev/sdk';

  const zavu = new Zavudev({
    apiKey: process.env['ZAVUDEV_API_KEY'], // This is the default and can be omitted
  });

  const result = await zavu.messages.send({
    to: "+14155551234",
    text: "Hello from Zavu!",
  });
  ```

  ```python Python theme={null}
  import os
  from zavudev import Zavudev

  zavu = Zavudev(
      api_key=os.environ.get("ZAVUDEV_API_KEY"),
  )

  result = zavu.messages.send(
      to="+14155551234",
      text="Hello from Zavu!"
  )
  ```

  ```ruby Ruby theme={null}
  require "zavudev"

  client = Zavudev::Client.new(api_key: ENV["ZAVUDEV_API_KEY"])

  result = client.messages.send(
    to: "+14155551234",
    text: "Hello from Zavu!"
  )
  ```

  ```go Go theme={null}
  client := zavudev.NewClient(option.WithAPIKey(os.Getenv("ZAVUDEV_API_KEY")))

  result, _ := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
  	To:   zavudev.String("+14155551234"),
  	Text: zavudev.String("Hello from Zavu!"),
  })
  ```

  ```php PHP theme={null}
  <?php
  $client = new Zavudev\Client(apiKey: getenv('ZAVUDEV_API_KEY'));

  $result = $client->messages->send([
      'to' => '+14155551234',
      'text' => 'Hello from Zavu!',
  ]);
  ```

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

<Tip>
  You can optionally specify a sender by passing `zavuSender` (TypeScript), `zavu_sender` (Python), or the `Zavu-Sender` header (cURL). If omitted, your project's default sender is used.
</Tip>

That's it. Zavu automatically:

* **Respects user preference**: When a user messages you first, we reply on the same channel they used
* **Optimizes outbound**: For business-initiated messages, selects the optimal channel based on cost and delivery rates
* **Falls back intelligently**: Tries alternative channels if delivery fails
* **Tracks everything**: Delivery status updates via API and webhooks

## How It Works

When you send a message without specifying a channel, your **default Sender** handles routing:

```
Your Message → Default Sender → Smart Routing → Best Channel → Delivery
```

### Senders

A Sender is a configuration that defines how messages are sent. Each Sender has:

* **Channels**: Which channels are available (SMS, WhatsApp, etc.)
* **Routing Policy**: `smart` (automatic) or `manual` (you choose)
* **Phone Numbers**: Configured for each channel

<Tip>
  Create your first Sender in the [Dashboard](https://dashboard.zavu.dev/senders) or via the [API](/api-reference/senders/create).
</Tip>

## Using a Specific Sender

If you have multiple Senders (e.g., "Marketing" and "Support"), specify which one to use:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const result = await zavu.messages.send({
    to: "+14155551234",
    text: "Your order has shipped!",
    zavuSender: "snd_abc123",
  });
  ```

  ```python Python theme={null}
  result = zavu.messages.send(
      to="+14155551234",
      text="Your order has shipped!",
      zavu_sender="snd_abc123"
  )
  ```

  ```ruby Ruby theme={null}
  result = client.messages.send(
    to: "+14155551234",
    text: "Your order has shipped!",
    zavu_sender: "snd_abc123"
  )
  ```

  ```go Go theme={null}
  result, _ := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
  	To:         zavudev.String("+14155551234"),
  	Text:       zavudev.String("Your order has shipped!"),
  	ZavuSender: zavudev.String("snd_abc123"),
  })
  ```

  ```php PHP theme={null}
  <?php
  $result = $client->messages->send([
      'to' => '+14155551234',
      'text' => 'Your order has shipped!',
  ], ['zavu_sender' => 'snd_abc123']);
  ```

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

## Specifying a Channel

For full control, specify the channel directly:

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

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

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

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

  ```php PHP theme={null}
  <?php
  $result = $client->messages->send([
      'to' => '+14155551234',
      'text' => 'Hello!',
      '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!",
      "channel": "whatsapp"
    }'
  ```
</CodeGroup>

Available channels: `sms`, `whatsapp`

## Response

A successful request returns the message details:

```json theme={null}
{
  "message": {
    "id": "msg_abc123",
    "to": "+14155551234",
    "text": "Hello from Zavu!",
    "channel": "whatsapp",
    "status": "queued",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}
```

| Status      | Description                             |
| ----------- | --------------------------------------- |
| `queued`    | Message accepted, pending delivery      |
| `sent`      | Sent to carrier/provider                |
| `delivered` | Confirmed delivered                     |
| `read`      | User opened the message (WhatsApp only) |
| `failed`    | Delivery failed                         |

## Next Steps

* [Smart Routing](/guides/sending-messages/smart-routing) - Learn how automatic channel selection saves up to 90% on messaging costs
* [SMS Guide](/guides/sending-messages/sms) - SMS-specific features and best practices
* [WhatsApp Guide](/guides/whatsapp/overview) - Rich messaging with media, buttons, and templates
