Send a Message
The 24-hour rule
Section titled “The 24-hour rule”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.
Send a template
Section titled “Send a template”Use this to start a conversation or message outside the 24h window.
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" } ] } ] }'Send a text (inside the 24h window)
Section titled “Send a text (inside the 24h window)”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." }'Body fields
Section titled “Body fields”| Field | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | Destination phone, any format (normalized to E.164). |
| type | string | text or template. Defaults to text. | |
| body | string | The message text. Required when type is text. | |
| template_name | string | The approved template’s name. Required when type is template. | |
| language_code | string | Template language, e.g. en, en_US. Defaults to en. | |
| components | array | Template variable values (header/body/button parameters), per the WhatsApp template component format. | |
| name | string | Optional contact name to set if this creates a new conversation. |
Response
Section titled “Response”{ "messaging_product": "whatsapp", "messages": [ { "id": "wamid.HBg...", "message_status": "accepted" } ]}