Send a WhatsApp message to a contact. Supports text, image, video, document, and template message types. The recipient can be identified by phone number, email, or contact ID. For media messages (image, video, document), provide a publicly accessible URL via mediaUrl.
Template messages can be sent at any time. Non-template messages (text, image, video, document) can only be sent within the 24-hour customer service window (i.e., within 24 hours of the customer's last reply).
Language codes for templates: Use the ISO-style WhatsApp language code that matches how the template was approved in Meta (e.g. "de", "en", "en_US"). Do not use language names such as "German" or "English" — those will be rejected with a 400 validation error.
Examples
Send OTP code via template:
{
"phone": "+4369912345678",
"type": "template",
"templateName": "otp_verification",
"language": "en",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "123456" }
]
}
]
}Send template with body variables and a URL button:
{
"phone": "+4369912345678",
"type": "template",
"templateName": "order_confirmation",
"language": "de",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "John" },
{ "type": "text", "text": "ORD-12345" }
]
},
{
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{ "type": "text", "text": "track123" }
]
}
]
}Send a plain text message (24h window must be open):
{
"phone": "+4369912345678",
"type": "text",
"text": "Hello, how can we help you?"
}| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||