Send a whatsapp template message
curl --request POST \
--url https://api.gleap.io/v3/engagement/whatsapp-messages/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'project: <project>' \
--data '
{
"to": "+14155552671",
"channelId": "6620f1a2b3c4d5e6f7890123",
"templateName": "order_confirmation",
"languageCode": "en_US",
"customValues": {
"order_number": "ORD-2026-4821",
"delivery_date": "March 15, 2026",
"customer_name": "John Doe"
}
}
'import requests
url = "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template"
payload = {
"to": "+14155552671",
"channelId": "6620f1a2b3c4d5e6f7890123",
"templateName": "order_confirmation",
"languageCode": "en_US",
"customValues": {
"order_number": "ORD-2026-4821",
"delivery_date": "March 15, 2026",
"customer_name": "John Doe"
}
}
headers = {
"project": "<project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
project: '<project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+14155552671',
channelId: '6620f1a2b3c4d5e6f7890123',
templateName: 'order_confirmation',
languageCode: 'en_US',
customValues: {
order_number: 'ORD-2026-4821',
delivery_date: 'March 15, 2026',
customer_name: 'John Doe'
}
})
};
fetch('https://api.gleap.io/v3/engagement/whatsapp-messages/send-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '+14155552671',
'channelId' => '6620f1a2b3c4d5e6f7890123',
'templateName' => 'order_confirmation',
'languageCode' => 'en_US',
'customValues' => [
'order_number' => 'ORD-2026-4821',
'delivery_date' => 'March 15, 2026',
'customer_name' => 'John Doe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"project: <project>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template"
payload := strings.NewReader("{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gleap.io/v3/engagement/whatsapp-messages/send-template")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/engagement/whatsapp-messages/send-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_bodyEngagement Whatsapp Messages
Send a whatsapp template message
POST
/
engagement
/
whatsapp-messages
/
send-template
Send a whatsapp template message
curl --request POST \
--url https://api.gleap.io/v3/engagement/whatsapp-messages/send-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'project: <project>' \
--data '
{
"to": "+14155552671",
"channelId": "6620f1a2b3c4d5e6f7890123",
"templateName": "order_confirmation",
"languageCode": "en_US",
"customValues": {
"order_number": "ORD-2026-4821",
"delivery_date": "March 15, 2026",
"customer_name": "John Doe"
}
}
'import requests
url = "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template"
payload = {
"to": "+14155552671",
"channelId": "6620f1a2b3c4d5e6f7890123",
"templateName": "order_confirmation",
"languageCode": "en_US",
"customValues": {
"order_number": "ORD-2026-4821",
"delivery_date": "March 15, 2026",
"customer_name": "John Doe"
}
}
headers = {
"project": "<project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
project: '<project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+14155552671',
channelId: '6620f1a2b3c4d5e6f7890123',
templateName: 'order_confirmation',
languageCode: 'en_US',
customValues: {
order_number: 'ORD-2026-4821',
delivery_date: 'March 15, 2026',
customer_name: 'John Doe'
}
})
};
fetch('https://api.gleap.io/v3/engagement/whatsapp-messages/send-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '+14155552671',
'channelId' => '6620f1a2b3c4d5e6f7890123',
'templateName' => 'order_confirmation',
'languageCode' => 'en_US',
'customValues' => [
'order_number' => 'ORD-2026-4821',
'delivery_date' => 'March 15, 2026',
'customer_name' => 'John Doe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"project: <project>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/engagement/whatsapp-messages/send-template"
payload := strings.NewReader("{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gleap.io/v3/engagement/whatsapp-messages/send-template")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/engagement/whatsapp-messages/send-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"+14155552671\",\n \"channelId\": \"6620f1a2b3c4d5e6f7890123\",\n \"templateName\": \"order_confirmation\",\n \"languageCode\": \"en_US\",\n \"customValues\": {\n \"order_number\": \"ORD-2026-4821\",\n \"delivery_date\": \"March 15, 2026\",\n \"customer_name\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Name of the WhatsApp template registered with Meta
The WhatsApp channel ID from your project
Recipient phone number (E.164 format, e.g. "+14155552671")
Key-value map of template variable overrides. Keys must match the templateVariable names from your variable mapping (e.g. { "order_number": "ORD-123", "customer_name": "John" }).
Typed any, not Record<...>: tsoa compiles Record to an empty model and silently-remove-extras guts it to {} — the overrides would be silently dropped (2026-07-12 strip audit).
Language code (e.g. "en_US"). Falls back to the contact's language or "en_US"
Response
200 - application/json
Ok
⌘I