array
curl -X POST "https://backend.conversales.in/api/v1/createTemplate" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {
"header_text_named_params": [
{ "param_name": "order_id", "example": "#12345" }
]
}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {
"body_text_named_params": [
{ "param_name": "customer_name", "example": "Jane" },
{ "param_name": "product_name", "example": "Wireless earbuds" },
{ "param_name": "delivery_date", "example": "2025-11-05" }
]
}
},
{
"type": "BUTTONS",
"buttons": [
{ "text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345" },
{ "text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567" }
]
}
]
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/createTemplate",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "order_confirmation",
category: "UTILITY",
language: "en",
components: [
{
type: "HEADER",
format: "TEXT",
text: "Order #{{1}} confirmed",
example: {
header_text_named_params: [
{ param_name: "order_id", example: "#12345" },
],
},
},
{
type: "BODY",
text: "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
example: {
body_text_named_params: [
{ param_name: "customer_name", example: "Jane" },
{ param_name: "product_name", example: "Wireless earbuds" },
{ param_name: "delivery_date", example: "2025-11-05" },
],
},
},
{
type: "BUTTONS",
buttons: [
{
text: "View Order",
type: "URL",
url: "https://shop.example.com/orders/12345",
},
{
text: "Contact Support",
type: "PHONE_NUMBER",
phone_number: "+15551234567",
},
],
},
],
}),
}
);
import requests
url = "https://backend.conversales.in/api/v1/createTemplate"
headers = {"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI", "Content-Type": "application/json"}
payload = {
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {"header_text_named_params": [{"param_name": "order_id", "example": "#12345"}]}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {"body_text_named_params": [{"param_name": "customer_name", "example": "Jane"}, {"param_name": "product_name", "example": "Wireless earbuds"}, {"param_name": "delivery_date", "example": "2025-11-05"}]}
},
{
"type": "BUTTONS",
"buttons": [
{"text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345"},
{"text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567"}
]
}
]
}
response = requests.post(url, json=payload, headers=headers)
{
"statusCode": 200,
"message": "Template created successfully",
"data": {
"templateId": "template_123456",
"name": "welcome_message",
"status": "PENDING",
"category": "MARKETING"
}
}
Template Operations
Create Template
Create a new WhatsApp message template
POST
/
api
/
v1
/
createTemplate
curl -X POST "https://backend.conversales.in/api/v1/createTemplate" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {
"header_text_named_params": [
{ "param_name": "order_id", "example": "#12345" }
]
}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {
"body_text_named_params": [
{ "param_name": "customer_name", "example": "Jane" },
{ "param_name": "product_name", "example": "Wireless earbuds" },
{ "param_name": "delivery_date", "example": "2025-11-05" }
]
}
},
{
"type": "BUTTONS",
"buttons": [
{ "text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345" },
{ "text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567" }
]
}
]
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/createTemplate",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "order_confirmation",
category: "UTILITY",
language: "en",
components: [
{
type: "HEADER",
format: "TEXT",
text: "Order #{{1}} confirmed",
example: {
header_text_named_params: [
{ param_name: "order_id", example: "#12345" },
],
},
},
{
type: "BODY",
text: "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
example: {
body_text_named_params: [
{ param_name: "customer_name", example: "Jane" },
{ param_name: "product_name", example: "Wireless earbuds" },
{ param_name: "delivery_date", example: "2025-11-05" },
],
},
},
{
type: "BUTTONS",
buttons: [
{
text: "View Order",
type: "URL",
url: "https://shop.example.com/orders/12345",
},
{
text: "Contact Support",
type: "PHONE_NUMBER",
phone_number: "+15551234567",
},
],
},
],
}),
}
);
import requests
url = "https://backend.conversales.in/api/v1/createTemplate"
headers = {"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI", "Content-Type": "application/json"}
payload = {
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {"header_text_named_params": [{"param_name": "order_id", "example": "#12345"}]}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {"body_text_named_params": [{"param_name": "customer_name", "example": "Jane"}, {"param_name": "product_name", "example": "Wireless earbuds"}, {"param_name": "delivery_date", "example": "2025-11-05"}]}
},
{
"type": "BUTTONS",
"buttons": [
{"text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345"},
{"text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567"}
]
}
]
}
response = requests.post(url, json=payload, headers=headers)
{
"statusCode": 200,
"message": "Template created successfully",
"data": {
"templateId": "template_123456",
"name": "welcome_message",
"status": "PENDING",
"category": "MARKETING"
}
}
Authentication
string
required
Your API key for authentication
Request Body
string
required
Template name (lowercase, underscore separated)
string
required
Template category:
MARKETING, UTILITY, or AUTHENTICATIONstring
required
Language code (e.g.,
en, en_US)array
required
Array of template components (header, body, footer, buttons)
Show Component Object Properties
Show Component Object Properties
string
required
Component type:
HEADER, BODY, FOOTER, BUTTONSstring
Header format when type=HEADER:
TEXT, IMAGE, VIDEO, DOCUMENT,
LOCATIONstring
Text content for BODY/FOOTER or HEADER when format=TEXT
object
Examples and named parameters for dynamic content
Show Example Properties
Show Example Properties
array
object|array
Media handle/reference for header images or videos
string
Example link URL for dynamic button URLs
array
Array of button objects (for BUTTONS component type)
Show Button Object Properties
Show Button Object Properties
string
required
Button display text
string
required
Button type:
URL, PHONE_NUMBER, QUICK_REPLY, COPY_CODE,
FLOW, MPM, OTP, VOICE_CALLstring
URL for URL type buttons
string
Phone number for PHONE_NUMBER buttons (E.164 format)
string
Example text or URL parameter value
string
Text auto-filled when button is clicked
string
Flow action identifier for WhatsApp Flows
string
Flow ID for WhatsApp Flows integration
string
Screen to navigate to in flow
string
Icon identifier or URL
string
OTP type:
ONE_TAP, ZERO_TAP, COPY_CODEboolean
Terms acceptance flag for zero-tap authentication
array
Array of supported app identifiers for the button
curl -X POST "https://backend.conversales.in/api/v1/createTemplate" \
-H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
-H "Content-Type: application/json" \
-d '{
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {
"header_text_named_params": [
{ "param_name": "order_id", "example": "#12345" }
]
}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {
"body_text_named_params": [
{ "param_name": "customer_name", "example": "Jane" },
{ "param_name": "product_name", "example": "Wireless earbuds" },
{ "param_name": "delivery_date", "example": "2025-11-05" }
]
}
},
{
"type": "BUTTONS",
"buttons": [
{ "text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345" },
{ "text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567" }
]
}
]
}'
const response = await fetch(
"https://backend.conversales.in/api/v1/createTemplate",
{
method: "POST",
headers: {
"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "order_confirmation",
category: "UTILITY",
language: "en",
components: [
{
type: "HEADER",
format: "TEXT",
text: "Order #{{1}} confirmed",
example: {
header_text_named_params: [
{ param_name: "order_id", example: "#12345" },
],
},
},
{
type: "BODY",
text: "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
example: {
body_text_named_params: [
{ param_name: "customer_name", example: "Jane" },
{ param_name: "product_name", example: "Wireless earbuds" },
{ param_name: "delivery_date", example: "2025-11-05" },
],
},
},
{
type: "BUTTONS",
buttons: [
{
text: "View Order",
type: "URL",
url: "https://shop.example.com/orders/12345",
},
{
text: "Contact Support",
type: "PHONE_NUMBER",
phone_number: "+15551234567",
},
],
},
],
}),
}
);
import requests
url = "https://backend.conversales.in/api/v1/createTemplate"
headers = {"X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI", "Content-Type": "application/json"}
payload = {
"name": "order_confirmation",
"category": "UTILITY",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order #{{1}} confirmed",
"example": {"header_text_named_params": [{"param_name": "order_id", "example": "#12345"}]}
},
{
"type": "BODY",
"text": "Hi {{1}}, your order for {{2}} has been confirmed and will arrive by {{3}}.",
"example": {"body_text_named_params": [{"param_name": "customer_name", "example": "Jane"}, {"param_name": "product_name", "example": "Wireless earbuds"}, {"param_name": "delivery_date", "example": "2025-11-05"}]}
},
{
"type": "BUTTONS",
"buttons": [
{"text": "View Order", "type": "URL", "url": "https://shop.example.com/orders/12345"},
{"text": "Contact Support", "type": "PHONE_NUMBER", "phone_number": "+15551234567"}
]
}
]
}
response = requests.post(url, json=payload, headers=headers)
{
"statusCode": 200,
"message": "Template created successfully",
"data": {
"templateId": "template_123456",
"name": "welcome_message",
"status": "PENDING",
"category": "MARKETING"
}
}
Templates must be approved by WhatsApp before use. Approval typically takes
24-48 hours.