@{contact_first_name}) that are automatically parsed before sending.messages:send| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
phone | string | Yes | min:10, max:20, regex: digits/+/-/spaces/() | Recipient phone number with country code |
message | string | Yes | max:4096 | Message text. Supports merge fields like @{contact_first_name} |
contact_id | integer | No | Must be valid integer | Existing contact ID (skips auto-creation lookup) |
@{contact_first_name} — Contact's first name@{contact_last_name} — Contact's last name@{contact_email} — Contact's email@{contact_phone} — Contact's phone numbercontact_id is provided and the phone number doesn't match an existing contact:| Field | Type | Description |
|---|---|---|
message_id | string | WhatsApp message ID (wamid format) |
contact_id | integer | Contact ID (existing or auto-created) |
phone | string | Cleaned phone number (digits only, no +) |
message | string | Final message text (after merge field parsing) |
status | string | Message status (sent) |
sent_at | string | ISO 8601 send timestamp |
chat_id | integer | Internal chat interaction ID |
chat_message_id | integer | Internal chat message record ID |
| Status | Error Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing API token |
| 403 | INSUFFICIENT_SCOPE | Token missing messages:send scope |
| 403 | FEATURE_LIMIT_EXCEEDED | Contact limit or conversation limit reached |
| 403 | CONTACT_OPTED_OUT | Contact has opted out of receiving messages |
| 404 | NOT_FOUND | Contact not found (when contact_id provided) |
| 422 | VALIDATION_ERROR | Request validation failed or missing config for auto-contact creation |
| 422 | WHATSAPP_NOT_CONFIGURED | WhatsApp not configured for this account |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 500 | MESSAGE_SEND_FAILED | Failed to send via WhatsApp API |
| 500 | INTERNAL_ERROR | Unexpected server error |
| Field | Message |
|---|---|
phone | Phone number is required / must be at least 10 digits / cannot exceed 20 characters / can only contain digits, +, -, spaces, and parentheses |
message | Message text is required / cannot exceed 4096 characters |
contact_id | Contact ID must be a valid integer |
curl --location --request POST '/messages/text' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"phone": "+919999999999",
"message": "Hello @{contact_first_name}! This is a test message.",
"contact_id": 1
}'{}