messages:sendapplication/json) and multipart form-data (for file uploads).| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
phone | string | Yes | Recipient phone number with country code | |
template_name | string | Yes | Must exist as APPROVED template | Template name |
language | string | Yes | max:10 | Template language code (e.g., en, en_GB) |
| Field | Type | Description |
|---|---|---|
contact_id | integer | Existing contact ID (skips auto-creation) |
| Field | Type | Description |
|---|---|---|
header_image_url | url | Image URL for IMAGE header |
header_image_file | file | Image file upload (max 5MB) |
header_video_url | url | Video URL for VIDEO header |
header_video_file | file | Video file upload (max 16MB) |
header_document_url | url | Document URL for DOCUMENT header |
header_document_file | file | Document file upload (max 100MB) |
header_document_name | string | Document display name (max 255 chars) |
header_field_1 | string | Text header parameter (for TEXT header with {{1}}) |
| Field | Type | Description |
|---|---|---|
field_1 to field_10 | string | Body parameters matching template placeholders {{1}} to {{10}}. Supports merge fields like @{contact_first_name} |
| Field | Type | Description |
|---|---|---|
button_0 to button_2 | string | Button parameters for dynamic URL buttons |
| Field | Type | Description |
|---|---|---|
auto_generate_otp | boolean | Auto-generate OTP code (for AUTHENTICATION templates) |
otp_field_number | integer | Which field receives the OTP (default: 1, must be 6) |
header_field_1 required if template has header parametersheader_image_url or header_image_file requiredheader_video_url or header_video_file requiredheader_document_url or header_document_file requiredfield_1 through field_N required for each body parameter| Field | Type | Description |
|---|---|---|
message_id | string | WhatsApp message ID |
contact_id | integer | Contact ID |
phone | string | Cleaned phone number |
template_name | string | Template name used |
language | string | Template language |
status | string | Message status (sent) |
sent_at | string | ISO 8601 send timestamp |
chat_id | integer | Internal chat interaction ID |
chat_message_id | integer|null | Internal chat message record ID |
| Status | Error Code | Description |
|---|---|---|
| 403 | FEATURE_NOT_AVAILABLE | WhatsApp templates not available in plan |
| 404 | NOT_FOUND | Template not found or not approved |
| 422 | VALIDATION_ERROR | Missing required template parameters |
| 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 |
template_name | Template name is required |
language | Template language is required |
curl --location --request POST '/messages/template' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'{}