Skip to main content

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.

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

Quick Start

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!",
});
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.
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
Create your first Sender in the Dashboard or via the API.

Using a Specific Sender

If you have multiple Senders (e.g., “Marketing” and “Support”), specify which one to use:
const result = await zavu.messages.send({
  to: "+14155551234",
  text: "Your order has shipped!",
  zavuSender: "snd_abc123",
});

Specifying a Channel

For full control, specify the channel directly:
const result = await zavu.messages.send({
  to: "+14155551234",
  text: "Hello!",
  channel: "whatsapp",
});
Available channels: sms, whatsapp

Response

A successful request returns the message details:
{
  "message": {
    "id": "msg_abc123",
    "to": "+14155551234",
    "text": "Hello from Zavu!",
    "channel": "whatsapp",
    "status": "queued",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}
StatusDescription
queuedMessage accepted, pending delivery
sentSent to carrier/provider
deliveredConfirmed delivered
readUser opened the message (WhatsApp only)
failedDelivery failed

Next Steps

  • Smart Routing - Learn how automatic channel selection saves up to 90% on messaging costs
  • SMS Guide - SMS-specific features and best practices
  • WhatsApp Guide - Rich messaging with media, buttons, and templates