Skip to content

Set up your WhatsApp Business API for free. No credit card needed.Set up your WhatsApp API for free.Get started

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.

Terminal window
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": "", "message_status": "queued", "hello_id": "5c0d8e2a-91b3-4f6e-a7d4-3b2c1e0f9a8d" }]
}

These examples show the asynchronous response (?async=true, or an API key set to asynchronous, the default). A key set to synchronous waits up to 25 seconds and returns WhatsApp’s own message ID as messages[0].id with message_status: "accepted", and Hello’s ID in hello_id. See Queued and synchronous sends.

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
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 (synchronous mode only) WhatsApp rejected the send

See Send a message for the fields and errors shared by every type.