ChatofyDevelopers
REST APIMCP Server (AI)New
API KeysWebhooks
Chatofy API
/
Getting Started
API Resources
API v1.0 Live
Developer APIMessagesSend Template (with Variables)

Send Template (with Variables)

Sends a pre-approved WhatsApp template message containing multiple dynamic body variables, header media parameters, and dynamic button URL variables. Parameters map sequentially to placeholders (e.g., parameter 0 -> {{1}}, parameter 1 -> {{2}}, parameter 2 -> {{3}}).

POST/api/v1/contact/{phone}/send-template-message

Recommendation

Body placeholders are positional: the 1st parameter replaces {{1}}, 2nd replaces {{2}}, 3rd replaces {{3}}. Ensure all required template placeholders have corresponding parameters in the array.

Body Parameters

1 parameter
{phone}stringrequired

Recipient phone number with country code (e.g. +919000000000).

Request Body Schema

application/json
template.namestringrequired

Template name (from Meta)

Example:order_delivery_update
template.language.codestringrequired

Language locale (e.g. en_US)

Example:en_US
template.componentsarray<object>required

Array of component objects (header, body, button) containing variable parameter arrays

template.components[].typestringrequired

Component type: "header", "body", or "button"

Example:body
template.components[].parametersarray<object>required

Array of parameter objects mapping to placeholders ({{1}}, {{2}}, etc.)

template.components[].parameters[].typestringrequired

Parameter type ("text", "image", "document", "currency", "date_time")

Example:text
template.components[].parameters[].textstringoptional

Dynamic text replacement for placeholder

Example:Sumit Singh

Response Payload

200 OKapplication/json
successbooleanrequired

Whether request succeeded

data.message_idstringrequired

Platform message ID (wamid)

data.raw.messages[].idstringrequired

Meta message ID

Code Snippets & Examples

1curl -X POST "https://app.chatofy.in/api/v1/contact/+919000000000/send-template-message" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "template": {
6 "name": "order_delivery_update",
7 "language": {
8 "code": "en_US"
9 },
10 "components": [
11 {
12 "type": "header",
13 "parameters": [
14 {
15 "type": "image",
16 "image": {
17 "link": "https://example.com/shipping-banner.jpg"
18 }
19 }
20 ]
21 },
22 {
23 "type": "body",
24 "parameters": [
25 {
26 "type": "text",
27 "text": "Sumit Singh"
28 },
29 {
30 "type": "text",
31 "text": "ORD-98412"
32 },
33 {
34 "type": "text",
35 "text": "Express Delivery"
36 }
37 ]
38 },
39 {
40 "type": "button",
41 "sub_type": "url",
42 "index": "0",
43 "parameters": [
44 {
45 "type": "text",
46 "text": "TRACK-98412"
47 }
48 ]
49 }
50 ]
51 }
52}'

Was this endpoint guide helpful?

Previous Endpoint
Send Template Message
Next Endpoint
Send Template (Body Variables Only)
© 2026 Chatofy Cloud Platform. All rights reserved.
1curl -X POST "https://app.chatofy.in/api/v1/contact/+919000000000/send-template-message" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "template": {
6 "name": "order_delivery_update",
7 "language": {
8 "code": "en_US"
9 },
10 "components": [
11 {
12 "type": "header",
13 "parameters": [
14 {
15 "type": "image",
16 "image": {
17 "link": "https://example.com/shipping-banner.jpg"
18 }
19 }
20 ]
21 },
22 {
23 "type": "body",
24 "parameters": [
25 {
26 "type": "text",
27 "text": "Sumit Singh"
28 },
29 {
30 "type": "text",
31 "text": "ORD-98412"
32 },
33 {
34 "type": "text",
35 "text": "Express Delivery"
36 }
37 ]
38 },
39 {
40 "type": "button",
41 "sub_type": "url",
42 "index": "0",
43 "parameters": [
44 {
45 "type": "text",
46 "text": "TRACK-98412"
47 }
48 ]
49 }
50 ]
51 }
52}'
200 OKapplication/json
1{
2 "success": true,
3 "data": {
4 "message_id": "wamid.HBgLMTIzNDU2...",
5 "raw": {
6 "messaging_product": "whatsapp",
7 "contacts": [
8 {
9 "input": "+919000000000",
10 "wa_id": "919000000000"
11 }
12 ],
13 "messages": [
14 {
15 "id": "wamid.HBgLMTIzNDU2..."
16 }
17 ]
18 }
19 },
20 "message": "Template message with variables sent successfully"
21}