Skip to navigation
WhatsApp

Send WhatsApp messages

View as MarkdownOpen in Claude

All WhatsApp messages are sent through the same endpoint as SMS and MMS, POST /api/messaging/messages. Two things route a message over WhatsApp instead of SMS/MMS:

  • The from number is a whatsapp:-prefixed WhatsApp number (e.g. whatsapp:+15557654321).
  • You set a message_type (for content messages) or a template_id (for template messages).

For the full request schema (every field, every message type’s body shape, and authentication), see the Send a message API reference. To send SMS and MMS from the same endpoint, or to handle incoming texts, see Send and receive messages.

Messaging rules

Meta enforces specific rules about when and how a business can send WhatsApp messages:

ScenarioWhat you can send
No prior customer messageApproved templates only. You cannot start a free-form conversation until the customer has responded.
Customer messaged firstAny message type (text, media, interactive, or template) within a 24-hour window from the customer’s last inbound message.

Message types

Set message_type to one of the following for a content message. Each value determines the shape of body, shown below.

whatsapp_media_textobjectRequired

Send a plain text WhatsApp message. Allowed only within the 24-hour customer service window.

OR
whatsapp_media_imageobjectRequired
Send an image message, with an optional caption.
OR
whatsapp_media_audioobjectRequired
Send an audio message.
OR
whatsapp_media_videoobjectRequired
Send a video message, with an optional caption.
OR
whatsapp_media_documentobjectRequired
Send a document message, with an optional filename and caption.
OR
whatsapp_media_stickerobjectRequired
Send a sticker message. Captions are not supported.
OR
whatsapp_media_locationobjectRequired
Share a location.
OR
whatsapp_media_contactsobjectRequired
Share one or more contact cards.
OR
whatsapp_media_reactionobjectRequired
React to a message with an emoji.
OR
whatsapp_interactive_ctaobjectRequired

Send a call-to-action URL interactive message. The body.type is cta_url and action carries the button's display text and URL.

OR
whatsapp_interactive_listobjectRequired

Send a list interactive message (up to 10 items).

OR
whatsapp_interactive_reply_buttonobjectRequired

Send a reply-button interactive message (up to 3 buttons). The body.type is button and each entry in action.buttons is a reply button.

OR
whatsapp_interactive_location_request_messageobjectRequired
Request the customer's location.

Examples

Plain text

{
"to": "+15551234567",
"from": "whatsapp:+15557654321",
"body": "Your appointment is confirmed for tomorrow at 2pm.",
"message_type": "whatsapp_media_text"
}

Interactive reply buttons

Send a message with tappable reply buttons, ideal for simple menus or surveys. The body.type is button and each entry in action.buttons is a reply button (up to 3).

{
"to": "+15551234567",
"from": "whatsapp:+15557654321",
"body": {
"type": "button",
"body": { "text": "How can we help?" },
"action": {
"buttons": [
{ "type": "reply", "reply": { "id": "sales", "title": "Talk to Sales" } },
{ "type": "reply", "reply": { "id": "support", "title": "Get Support" } },
{ "type": "reply", "reply": { "id": "exit", "title": "No thanks" } }
]
}
},
"message_type": "whatsapp_interactive_reply_button"
}

Template message

Use a template when reaching out to a customer for the first time, or outside the 24-hour window. Provide the template_id and fill in any placeholders; the template must be approved. Use an array for positional parameters or an object for named parameters.

{
"to": "+15551234567",
"from": "whatsapp:+15557654321",
"template_id": "{template_id}",
"header_template_parameters": ["Jane Smith"],
"body_template_parameters": ["ORD-9821", "out for delivery"]
}

Next steps