WhatsApp Templates
Send WhatsApp messages
Retrieves WhatsApp templates
/whatsapp_templatesReturns all approved WhatsApp Business templates for the account.
Only templates with status: approved can be used to send messages.
Templates are required to initiate conversations outside the 24-hour window.
Responses
200whatsapp templates found401unauthorized
curl -X GET 'https://api.vixiees.com/api/v1/whatsapp_templates' \
-H 'X-Api-Key: YOUR_API_KEY'{
"results": [
{
"_id": "string",
"name": "string",
"status": "string",
"content": "string",
"category": "string",
"language": "string",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
]
}Sends a WhatsApp template message
/whatsapp_templates/{id}/send_messageSends a WhatsApp template message to a contact.
Use body_parameters to fill the template's body variables ({{1}}, {{2}}, ...). It is
positional — the first element fills {{1}}, the second {{2}}, and so on — and each element
must be { "type": "text", "text": "..." } (no name/value). The number of elements should
match the number of variables in the template.
For templates with media headers, use header_parameters with document/image/video links.
For templates with URL buttons, use buttons_parameters to set the dynamic URL suffix.
Use from_phone_number to choose which of the account's WhatsApp numbers sends the message.
Path parameters
- The ID of the WhatsApp template to send
idstringrequiredExample:64a1b2c3d4e5f678901234ab
Request body · application/json
contact_idstringrequiredExample:64a1b2c3d4e5f678901234cdfrom_phone_numberstringExample:+1234567890- Positional: the first element fills {{1}}, the second {{2}}, etc. Count must match the template.
body_parametersarray<object> body_parameters[].typestringrequiredExample:textbody_parameters[].textstringExample:Johnheader_parametersarray<object>header_parameters[].typestringrequiredExample:documentheader_parameters[].documentobjectheader_parameters[].document.linkstringExample:https://example.com/document.pdfbuttons_parametersarray<object>buttons_parameters[].typestringrequiredExample:buttonbuttons_parameters[].sub_typestringrequiredExample:urlbuttons_parameters[].indexintegerrequiredExample:0buttons_parameters[].parametersarray<object>buttons_parameters[].parameters[].typestringExample:textbuttons_parameters[].parameters[].textstringExample:12
Responses
200message sent with buttons parameters401unauthorized404template not found422unprocessable entity503WhatsApp connection failed
curl -X POST 'https://api.vixiees.com/api/v1/whatsapp_templates/64a1b2c3d4e5f678901234ab/send_message' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contact_id": "64a1b2c3d4e5f678901234cd",
"from_phone_number": "+1234567890",
"body_parameters": [
{
"type": "text",
"text": "John"
}
],
"header_parameters": [
{
"type": "document",
"document": {
"link": "https://example.com/document.pdf"
}
}
],
"buttons_parameters": [
{
"type": "button",
"sub_type": "url",
"index": 0,
"parameters": [
{
"type": "text",
"text": "12"
}
]
}
]
}'{}