curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}'
curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {
"mode": "custom",
"value": "John Doe"
},
"orderId": {
"mode": "custom",
"value": "ORD-12345"
},
"amount": {
"mode": "custom",
"value": "$99.99"
}
}
},
"clientId": "order-tracking-12345"
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "hello_world",
templateLanguage: "en",
}),
}
);
const data = await response.json();
console.log(data);
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "order_confirmation",
templateLanguage: "en",
templateVars: {
body: {
name: { mode: "custom", value: "John Doe" },
orderId: { mode: "custom", value: "ORD-12345" },
amount: { mode: "custom", value: "$99.99" },
},
},
clientId: "order-tracking-12345",
}),
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {"mode": "custom", "value": "John Doe"},
"orderId": {"mode": "custom", "value": "ORD-12345"},
"amount": {"mode": "custom", "value": "$99.99"}
}
},
"clientId": "order-tracking-12345"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"statusCode": 200,
"message": "Template message sent successfully",
"data": {
"messageId": "wamid.HBgNMTIzNDU2Nzg5MAUCABIYFjNFQjBDMTg5RjNCN0Q5OEQyMDhGAA==",
"status": "sent",
"recipient": "+1234567890"
}
}
{
"statusCode": 400,
"message": "Key: 'ExternalTemplateRequest.To' Error:Field validation for 'To' failed on the 'required' tag",
"data": null
}
{
"statusCode": 500,
"message": "template 'order_confirmation' with language 'en' not found",
"data": null
}
{
"statusCode": 401,
"message": "Invalid API key",
"data": null
}
Chat Operations
Send Template Message
Send WhatsApp template messages with optional dynamic variables
POST
/
api
/
v1
/
sendTemplateMessage
curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}'
curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {
"mode": "custom",
"value": "John Doe"
},
"orderId": {
"mode": "custom",
"value": "ORD-12345"
},
"amount": {
"mode": "custom",
"value": "$99.99"
}
}
},
"clientId": "order-tracking-12345"
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "hello_world",
templateLanguage: "en",
}),
}
);
const data = await response.json();
console.log(data);
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "order_confirmation",
templateLanguage: "en",
templateVars: {
body: {
name: { mode: "custom", value: "John Doe" },
orderId: { mode: "custom", value: "ORD-12345" },
amount: { mode: "custom", value: "$99.99" },
},
},
clientId: "order-tracking-12345",
}),
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {"mode": "custom", "value": "John Doe"},
"orderId": {"mode": "custom", "value": "ORD-12345"},
"amount": {"mode": "custom", "value": "$99.99"}
}
},
"clientId": "order-tracking-12345"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"statusCode": 200,
"message": "Template message sent successfully",
"data": {
"messageId": "wamid.HBgNMTIzNDU2Nzg5MAUCABIYFjNFQjBDMTg5RjNCN0Q5OEQyMDhGAA==",
"status": "sent",
"recipient": "+1234567890"
}
}
{
"statusCode": 400,
"message": "Key: 'ExternalTemplateRequest.To' Error:Field validation for 'To' failed on the 'required' tag",
"data": null
}
{
"statusCode": 500,
"message": "template 'order_confirmation' with language 'en' not found",
"data": null
}
{
"statusCode": 401,
"message": "Invalid API key",
"data": null
}
Authentication
Your API key for authentication
Request Body
Recipient’s phone number in international format (e.g., +1234567890)
Name of the WhatsApp template to use
Language code for the template (e.g.,
en, en_US)Template variable mappings (only required if template has dynamic variables)
Show Template Variables Properties
Show Template Variables Properties
URL for header media (image, video, document). Must be HTTPS and publicly accessible.
Optional client reference ID for tracking
Response
HTTP status code (200 for success)
Success or error message
curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}'
curl -X POST "https://backend.conversales.in/api/v1/sendTemplateMessage" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {
"mode": "custom",
"value": "John Doe"
},
"orderId": {
"mode": "custom",
"value": "ORD-12345"
},
"amount": {
"mode": "custom",
"value": "$99.99"
}
}
},
"clientId": "order-tracking-12345"
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "hello_world",
templateLanguage: "en",
}),
}
);
const data = await response.json();
console.log(data);
const response = await fetch(
"https://backend.conversales.in/api/v1/sendTemplateMessage",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+1234567890",
templateName: "order_confirmation",
templateLanguage: "en",
templateVars: {
body: {
name: { mode: "custom", value: "John Doe" },
orderId: { mode: "custom", value: "ORD-12345" },
amount: { mode: "custom", value: "$99.99" },
},
},
clientId: "order-tracking-12345",
}),
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "hello_world",
"templateLanguage": "en"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
import requests
url = "https://backend.conversales.in/api/v1/sendTemplateMessage"
headers = {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json"
}
payload = {
"to": "+1234567890",
"templateName": "order_confirmation",
"templateLanguage": "en",
"templateVars": {
"body": {
"name": {"mode": "custom", "value": "John Doe"},
"orderId": {"mode": "custom", "value": "ORD-12345"},
"amount": {"mode": "custom", "value": "$99.99"}
}
},
"clientId": "order-tracking-12345"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"statusCode": 200,
"message": "Template message sent successfully",
"data": {
"messageId": "wamid.HBgNMTIzNDU2Nzg5MAUCABIYFjNFQjBDMTg5RjNCN0Q5OEQyMDhGAA==",
"status": "sent",
"recipient": "+1234567890"
}
}
{
"statusCode": 400,
"message": "Key: 'ExternalTemplateRequest.To' Error:Field validation for 'To' failed on the 'required' tag",
"data": null
}
{
"statusCode": 500,
"message": "template 'order_confirmation' with language 'en' not found",
"data": null
}
{
"statusCode": 401,
"message": "Invalid API key",
"data": null
}
Variable Modes: -
custom - Use the provided value directly -
contactfield - Look up the value from the contact database using the field
nameTemplates must be pre-approved by WhatsApp before use. Variable names must
match template placeholders exactly. Contact field lookups are case-sensitive.
Use the
clientId parameter to track messages in your own system. This ID
will be returned in webhooks and status updates.Media URLs (headerMediaUrl) must be HTTPS and publicly accessible. Templates
with media headers require a valid URL to be provided.
⌘I