Send a text message
A plain text message. It can only be sent while the recipient’s 24-hour window is open. To message someone outside the window, send a template.
Example
Section titled “Example”curl -X POST "$HELLO_API_URL/v1/<your-phone-number-id>/messages" \ -H "Authorization: Bearer $HELLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": "+919999999999", "type": "text", "text": { "body": "Your table for 4 is confirmed for 8 pm. Reply CHANGE to reschedule.", "preview_url": false } }'Response (202 Accepted):
{ "messaging_product": "whatsapp", "contacts": [{ "input": "+919999999999", "wa_id": "919999999999" }], "messages": [{ "id": "5c0d8e2a-91b3-4f6e-a7d4-3b2c1e0f9a8d", "message_status": "queued" }]}Add ?sync=true to wait up to 10 seconds for WhatsApp to accept it. See
Queued and synchronous sends.
Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
text.body |
string | Yes | Message text. Up to 4,096 characters (WhatsApp’s limit). |
text.preview_url |
boolean | No | true to show a preview of the first URL in body |
Common errors
Section titled “Common errors”| Status | code |
Cause |
|---|---|---|
403 |
OUTSIDE_24H_WINDOW |
The recipient’s 24-hour window is closed. Send a template instead. |
400 |
VALIDATION_ERROR |
text is missing or the wrong shape |
422 |
SEND_FAILED |
(?sync=true only) WhatsApp rejected the send |
See Send a message for the fields and errors shared by every type.