Skip to main content
This endpoint sends a WhatsApp message using a pre-approved template. Template messages are required when initiating a conversation with a user for the first time or when messaging outside the 24-hour messaging window.
This endpoint is rate-limited to 5 requests per second per user.

Request Body

sender_id integer required The ID of the WhatsApp sender to send from (obtained from the Get Senders endpoint) template_id integer required The ID of the message template to use (obtained from the Get Templates endpoint) recipient_phone string required The recipient’s phone number in international format (e.g., +1234567890) recipient_name string The recipient’s name, max 255 characters (used for conversation tracking and CRM purposes) variables object Key-value pairs for template variables. Keys should match the variable names from the template. If the template has variables {{1}}, {{2}}, etc., provide them as {"1": "value1", "2": "value2"} or using the named keys from the template’s variables array. Example variables 1 string Value for the first template variable 2 string Value for the second template variable

Response Fields

success boolean Whether the message was sent successfully conversation_id integer The ID of the conversation (new or existing) associated with this message message_id integer The ID of the conversation message record whatsapp_message_id integer The ID of the WhatsApp message record message_sid string The Twilio message SID for tracking delivery status string The initial message delivery status (e.g., queued, sent)

Error Responses

402 Insufficient Balance Error Response success boolean false error string Insufficient balance. Please top up your account. error_code string INSUFFICIENT_BALANCE 404 Not Found Error Response success boolean false error string Sender not found or does not belong to you or Template not found or does not belong to this sender error_code string SENDER_NOT_FOUND or TEMPLATE_NOT_FOUND 422 Unprocessable Entity Error Response success boolean false error string Detailed error message error_code string One of: SENDER_OFFLINE, TEMPLATE_NOT_APPROVED, TEMPLATE_NOT_SYNCED, TEMPLATE_MISMATCH, NO_ASSISTANT_CONFIGURED, INVALID_PHONE, MESSAGING_LIMIT_UNAVAILABLE, VOICE_CALL_LIMIT_NOT_MET, TWILIO_ERROR_{code}, UNKNOWN_ERROR
cURL
Template without variables
JavaScript
Python
200 Success
402 Insufficient Balance
404 Sender Not Found
404 Template Not Found
422 Template Not Approved
422 Invalid Phone
422 Sender Offline

Notes

  • Template messages must use approved templates. Templates with pending or rejected status will fail.
  • The sender must be online. Offline senders cannot send messages.
  • Message costs are automatically deducted from your account balance (chat credits).
  • After sending a template message, a 24-hour messaging window opens. During this window, you can send freeform messages without needing a template.
  • If a conversation already exists with the recipient, the message is added to the existing conversation.
  • Rate limit: 5 requests per second per user.