WhatsApp Automation

Automate WhatsApp.
End to end.

One API to send and receive. Serverless Functions to run your logic. A CLI to ship it. Build an AI-powered WhatsApp automation and deploy it in an afternoon — no servers, no webhook plumbing.

Free tier · No credit card required

send.ts
import Zavudev from '@zavudev/sdk'

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY })

// Send WhatsApp — auto-fallback to SMS if it can't deliver
const result = await zavu.messages.send({
  to: '+14155551234',
  channel: 'whatsapp',
  text: 'Your table for 2 is confirmed for 9 PM.',
})

console.log(result.message.channel, result.message.status)
// whatsapp  queued

Why Zavu

Everything else makes you host it yourself.

Zavu is the messaging and the compute in one platform. You write the logic — we run it, route it, and keep it observable.

One API, every channel

Send and receive WhatsApp — with automatic SMS fallback when a message can't be delivered.

Serverless Functions

Your automation logic runs on Zavu Cloud. Nothing to rent, patch, or scale. No webhook plumbing.

AI-native

Drop in an agent with defineAgent. Use our managed models, or bring your own keys.

Ship from your terminal

A real CLI: init, deploy, logs, secrets, triggers — the whole loop from your shell.

Smart routing

ML routing plus fallback cut messaging cost by 30–80% without touching your code.

Native inbound

Typing indicators, reactions, quoted replies, and the 24-hour window — handled for you.

vs. the rest

Built to skip the busywork.

DIY / self-hostTypical BSPZavu
Run your logicRent & scale a serverWebhooks you hostServerless Functions
AI agentBuild it yourselfAdd-on or nonedefineAgent, managed
DeployCustom pipelineDashboard onlynpx zavudev deploy
SMS fallbackWire it manuallyLimitedAutomatic
CostInfra + messagesPer-seat markupPay per message

The guide

From zero to a live WhatsApp agent.

Five steps. Every command and snippet below is real — copy them straight into your terminal.

Step 01

Install & log in

Grab the CLI and the SDK, then authenticate. The CLI saves your key locally and picks the right project.

zsh
# Install the CLI (macOS / Linux)
$ npx zavudev@latest login
# ...and the SDK for your app
$ npm add @zavudev/sdk
$ npx zavudev login
✓ Authorized · saved to ~/.zavu/credentials.json
$ npx zavudev whoami
Project: Acme Restaurants
Mode: live
Key ending: …1bmmn

Step 02

Connect WhatsApp

Find the sender you'll automate. Onboard clients at scale with invitations — they finish WhatsApp Business signup and the sender lands in your project.

zsh
$ npx zavudev senders list
id name phone whatsapp
jn76…1bmmn Pizzeria Main +15076323077 yes
$ export SENDER_ID="jn76vnxet8g5nq661by3v06y1581bmmn"

Step 03

Send your first message

One send() call. Add interactive buttons, lists, media, or templates — same API, one field changes.

reply.ts
await zavu.messages.send({
  to: '+14155551234',
  channel: 'whatsapp',
  messageType: 'buttons',
  text: 'Your table is ready. What would you like to do?',
  content: {
    buttons: [
      { id: 'confirm', title: 'Confirm' },
      { id: 'cancel',  title: 'Cancel' },
      { id: 'delay',   title: '15 min late' },
    ],
  },
})

Step 04

Ship an AI agent

Scaffold a function, then declare an agent with defineAgent and give it tools with defineTool. The agent auto-binds to the sender — no triggers to wire.

zsh
$ npx zavudev fn init --template restaurant-booking -y
$ cd reservations
$ npx zavudev fn secrets set SENDER_ID "$SENDER_ID"
✓ Created SENDER_ID (…1bmmn)
index.ts
import { defineAgent, defineTool } from '@zavu/functions'

defineAgent({
  senderId: process.env.SENDER_ID!,
  name: 'Bella',
  provider: 'zavu',            // managed AI — no keys to bring
  model: 'openai/gpt-4o-mini',
  channels: ['whatsapp'],
  prompt: 'You are Bella, the host at Bella Pizzeria. Be warm and concise.',
})

defineTool({
  name: 'check_availability',
  description: 'Check open tables for a date and party size.',
  parameters: {
    type: 'object',
    properties: {
      date: { type: 'string' },
      partySize: { type: 'number' },
    },
    required: ['date', 'partySize'],
  },
  handler: async ({ date, partySize }) => {
    // your booking system here
    return { slots: ['19:30', '21:00'] }
  },
})

Step 05

Deploy & watch it live

One command bundles, uploads, and publishes. From then on, every inbound WhatsApp message runs your agent — stream it live with logs.

zsh
$ npx zavudev deploy
› status: bundling
› status: uploading
› status: publishing
› status: active
✓ Deployed in 14s
Agents synced: + Bella
Tools synced: + check_availability
$ npx zavudev fn logs --tail
live · every inbound now runs your agent

Functions & CLI

Ship from your terminal.

Zavu Functions run your code in the cloud, bound natively to messaging events. The zavu CLI is the whole loop — init, deploy, logs, secrets, triggers.

zavu
# Deploy, watch, and manage — all from the shell
$ npx zavudev deploy
$ npx zavudev fn logs --tail --since 2h --filter ERROR
$ npx zavudev fn secrets set OPENAI_API_KEY sk-…
$ npx zavudev fn triggers add --events message.inbound --senders any
$ npx zavudev fn invoke --event message.inbound --from +1415… --text "hola"
$ npx zavudev messages send --to +56912345678 --text "Hello"

Native event triggers

Bind to message.inbound, delivered, read, failed — per sender or all.

Encrypted secrets

Store keys per function. ZAVU_API_KEY is provisioned automatically.

Live logs

Stream invocation logs with npx zavudev fn logs --tail and CloudWatch filters.

Versioned deploys

Every deploy is a version. Roll back to any of them in one call.

Public HTTPS endpoints

Flip on a public URL to invoke a function over HTTPS from anywhere.

Local invoke

Test the real handler with a synthetic event — no cloud round-trip.

The full toolkit

Everything WhatsApp can do.

Call any of it from a send(), a broadcast, or inside a function.

Text messages
Image · video · docs
Interactive buttons
List menus
CTA URL buttons
Approved templates
Reactions
Quoted replies
24h window handling
Broadcasts
AI agents
Inbound webhooks

Outcomes

Less to run. More shipped.

1 API

Every channel

WhatsApp, SMS, Email, Voice, and more behind one send() call.

seconds

Deploy

npx zavudev deploy bundles, uploads, and goes live in one command.

30–80%

Lower cost

ML routing and fallback trim messaging spend automatically.

100%

Observability

Every message and agent run is logged, traceable, and queryable.

Ship your WhatsApp automation

Send your first message in minutes. Deploy your first agent this afternoon. No servers, no hosting, no overhead.

WhatsApp Automation | Serverless Functions + CLI | Zavu | Zavu