Send a Message
The API sends two kinds of WhatsApp messages: template messages and free-form messages. Which one you can send depends on the customer service window.
Message types
| Template messages | Free-form messages | |
|---|---|---|
| When you can send | Any time | Only while the customer service window is open |
| Approval | Pre-approved by WhatsApp | No template approval needed |
| What you can send | The approved template — text, media, location, buttons, and carousels | Text and media (image, video, audio, and document) |
| Endpoint | POST /v1/whatsapp/send | POST /v1/whatsapp/send/textPOST /v1/whatsapp/send/media |
| Best for | Notifications, OTPs, re-engagement, and reopening a conversation | Conversational replies inside an open window |
To start or reopen a conversation, send a template. Once the customer replies, the customer service window opens and you can reply with free-form text or media. When the window closes, send another template.
Free-form text and media can only be sent while the customer service window is open. Template messages can be sent at any time.
Customer service window
The customer service window is the rolling 24-hour period measured from your customer’s most recent incoming message. It opens when the customer messages you, and each new incoming message restarts it — so the window always closes 24 hours after their latest message.
For example, if a customer messages you at 09:00 on Monday, you can send free-form messages until 09:00 on Tuesday. If they message again at 15:00 on Monday, the window now runs until 15:00 on Tuesday.
Only an incoming message from the customer opens or extends the window. Sending a template does not. The window is tracked per customer and per WhatsApp phone number; if you have not received a recent inbound message, treat it as closed.
Your webhook receives every incoming message. Use the timestamp on the
latest incoming customer reply to track
when the current window closes.
Shared request fields
Both message types accept the same recipient fields:
| Field | Type | Required | Description |
|---|---|---|---|
to | string | ✓ | Recipient phone number in E.164 format (e.g. +254700000000) |
phone_number_id | string | ✓ | Your sending phone number id from Phone Numbers |
Each message type adds its own fields:
- Template Messages —
template_name,language_code, and optionalvariables, media, catalog, or location fields. - Free-form Messages —
text, or amedia_typewith a publicmedia_url.
Send a message
Send an approved template at any time, including to reopen a conversation.
Template MessagesReply with text or media while the customer service window is open.
Free-form MessagesFill named and positional placeholders in a template’s header and body.
Template VariablesSend one-time passcodes with authentication templates.
Authentication (OTP)Override a template’s header image, video, or document per send.
Template MediaSend multi-card carousels and fill each card’s own variables.
Carousels