Docs · Product guides
How WhatsApp works
Link a WhatsApp number to talks, send and receive messages through the API, and put an AI agent on it.
The building blocks
Link a number
Option A: scan a QR code
Get a code
POST /v1/whatsapp/subscriptions/{id}/generate-qr returns qr_code and qr_code_url.
Scan it
On the business phone: WhatsApp → Settings → Linked devices → Link a device.
Confirm
Poll GET /v1/whatsapp/subscriptions/{id}/link-status every few seconds until status is connected.
Option B: your WhatsApp Business Platform account
Already on Meta's official platform? POST /v1/whatsapp/subscriptions/{id}/connect-official with phone_number_id, waba_id and access_token. talks checks them with Meta before saving.
Warning: If the phone logs out of WhatsApp or the app is removed, a QR link drops. Check link-status before big sends and re-link if needed.
Send messages
Add scheduled_at to send later, and cancel before it goes with DELETE /v1/whatsapp/messages/{message_id}. Check any message with GET /v1/whatsapp/messages/{message_id}.
Receive messages
Customer replies arrive on your webhook as they come in, and the full history for a number is at GET /v1/whatsapp/subscriptions/{id}/messages.
Put an AI agent on it
Create
POST /v1/whatsapp/agents with a system_prompt, business facts in system_context and a greeting_message.
Give it tools
POST /v1/whatsapp/agents/{id}/tools so it can call your APIs for stock, bookings or payments.
Test privately
POST /v1/whatsapp/agents/{id}/chat lets you talk to it without touching real customers. The reply shows which tools it called.
{ "message": "Do you have braids on Saturday?", "customer_name": "Test" }Go live
POST /v1/whatsapp/agents/{id}/activate. Use auto_reply_include and auto_reply_exclude to choose who it answers.
Watch it
GET /v1/whatsapp/agents/{id}/conversations and /stats show every chat, response times and tool use.
Tip: Not sure which AI model to use? POST /v1/whatsapp/agents/models/auto-select benchmarks them and returns the best fit for speed and quality.
Keep it running
Each subscription has expires_at. Renew with POST /v1/whatsapp/subscriptions/{id}/renew, or cancel with DELETE /v1/whatsapp/subscriptions/{id}.