Send WhatsApp

Send WhatsApp messages through Zend using the official WhatsApp Cloud API. Business-initiated conversations must use approved message templates, so every WhatsApp send references a template_id and its template_params.

Messages are sent through the same POST /messages endpoint you use for other channels — set preferred_channels to ["whatsapp"] and supply the template to render.

POST/messages

Templates are required

WhatsApp requires approved template messages for business-initiated conversations. You cannot send free-form text as the first message to a customer. Every business-initiated WhatsApp send must include a template_id and the template_params that fill the template's variables.

Note

If you call POST /messages for WhatsApp without a template, the request is rejected with a 400. See WhatsApp delivery & fallback for the exact error responses.

Basic template send

Send a WhatsApp message by referencing an approved template and passing its variables:

curl -X POST https://api.tryzend.com/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+233593152134",
    "body": "Welcome to our service!",
    "preferred_channels": ["whatsapp"],
    "template_id": "6884c5d09c14b2b164500d58",
    "template_params": {
      "code": "123456",
      "verification_url": "https://yourapp.com/verify?code=123456"
    }
  }'

Response:

{
  "id": "6884da240f0e633b7b979bff",
  "status": "pending",
  "estimated_cost": 0.008,
  "message": "Message queued for processing"
}

Request fields

tostringrequired
Recipient phone number in E.164 format, e.g. +233593152134.
preferred_channelsstring[]required
Channels to attempt, in order. Use ["whatsapp"] for WhatsApp-only, or add more channels for fallback.
template_idstringrequired
ID of the approved template to render for this message.
template_paramsobjectrequired
Key-value pairs that fill the template's variables. Every required variable must be provided.
bodystring
Optional plain-text description of the message. The rendered template content is what the recipient receives.

Message limits

LimitValue
Text1024 characters
Header60 characters
Footer60 characters
Button text25 characters per button
Rate limit50 messages per minute
Cost$0.008 per message

Best practices

Keep template content concise and clear, use emojis sparingly, and test how content renders on small screens. Limit templates to a maximum of 3 buttons with clear, action-oriented text, and serve any media over HTTPS URLs under 16MB. See the WhatsApp best practices reflected throughout the guides below.

Note

Design and manage the templates themselves in Templates.

Next steps