Skip to content

Send a Message

WhatsApp only allows free-form text within 24 hours of the customer’s last message. Outside that window (or to start a fresh conversation), you must send an approved template. Whatbot follows this automatically — pick the right type.

Use this to start a conversation or message outside the 24h window.

cURL
curl -X POST https://api.whatbot.in/public/v1/messages \
-H "X-API-Key: wa_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"to": "9876543210",
"type": "template",
"template_name": "order_update",
"language_code": "en",
"components": [
{ "type": "body", "parameters": [ { "type": "text", "text": "Ravi" } ] }
]
}'
cURL
curl -X POST https://api.whatbot.in/public/v1/messages \
-H "X-API-Key: wa_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "to": "9876543210", "type": "text", "body": "Thanks! Your order ships today." }'
FieldTypeRequiredDescription
tostringYesDestination phone, any format (normalized to E.164).
typestringtext or template. Defaults to text.
bodystringThe message text. Required when type is text.
template_namestringThe approved template’s name. Required when type is template.
language_codestringTemplate language, e.g. en, en_US. Defaults to en.
componentsarrayTemplate variable values (header/body/button parameters), per the WhatsApp template component format.
namestringOptional contact name to set if this creates a new conversation.
200
{
"messaging_product": "whatsapp",
"messages": [ { "id": "wamid.HBg...", "message_status": "accepted" } ]
}