Create WhatsApp template
Submit a new template for review. Approval usually takes minutes; you’ll see the status change in List WhatsApp templates.
Scope: whatsapp:send.
For a media header send multipart/form-data with the JSON above as a data field and the sample file as headerSample (JPEG/PNG, MP4 or PDF).
On the shared number, templates go to in_review first and are then submitted to Meta.
POST
/
whatsapp
/
templates
Create WhatsApp template
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_ready",
"language": "en",
"category": "utility",
"components": {
"body": {
"text": "Hi {{1}}, order {{2}} is ready for pickup.",
"examples": {
"1": "Jane",
"2": "A1042"
}
},
"footer": "Reply STOP to opt out",
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/o/{{1}}",
"urlExample": "https://shop.example.com/o/A1042"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'order_ready',
language: 'en',
category: 'utility',
components: {
body: JSON.stringify({
text: 'Hi {{1}}, order {{2}} is ready for pickup.',
examples: {'1': 'Jane', '2': 'A1042'}
}),
footer: 'Reply STOP to opt out',
buttons: [
{
type: 'URL',
text: 'Track order',
url: 'https://shop.example.com/o/{{1}}',
urlExample: 'https://shop.example.com/o/A1042'
}
]
}
})
};
fetch('https://app.telaven.com/api/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/templates"
payload = {
"name": "order_ready",
"language": "en",
"category": "utility",
"components": {
"body": {
"text": "Hi {{1}}, order {{2}} is ready for pickup.",
"examples": {
"1": "Jane",
"2": "A1042"
}
},
"footer": "Reply STOP to opt out",
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/o/{{1}}",
"urlExample": "https://shop.example.com/o/A1042"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/templates",
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([
'name' => 'order_ready',
'language' => 'en',
'category' => 'utility',
'components' => [
'body' => [
'text' => 'Hi {{1}}, order {{2}} is ready for pickup.',
'examples' => [
'1' => 'Jane',
'2' => 'A1042'
]
],
'footer' => 'Reply STOP to opt out',
'buttons' => [
[
'type' => 'URL',
'text' => 'Track order',
'url' => 'https://shop.example.com/o/{{1}}',
'urlExample' => 'https://shop.example.com/o/A1042'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/templates");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"order_ready\",\n \"language\": \"en\",\n \"category\": \"utility\",\n \"components\": {\n \"body\": {\n \"text\": \"Hi {{1}}, order {{2}} is ready for pickup.\",\n \"examples\": {\n \"1\": \"Jane\",\n \"2\": \"A1042\"\n }\n },\n \"footer\": \"Reply STOP to opt out\",\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/o/{{1}}\",\n \"urlExample\": \"https://shop.example.com/o/A1042\"\n }\n ]\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"data": {
"id": "7d2c…",
"name": "order_ready",
"status": "pending",
"rejectionReason": null
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Body
application/json
Response
Success
⌘I
Create WhatsApp template
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_ready",
"language": "en",
"category": "utility",
"components": {
"body": {
"text": "Hi {{1}}, order {{2}} is ready for pickup.",
"examples": {
"1": "Jane",
"2": "A1042"
}
},
"footer": "Reply STOP to opt out",
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/o/{{1}}",
"urlExample": "https://shop.example.com/o/A1042"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'order_ready',
language: 'en',
category: 'utility',
components: {
body: JSON.stringify({
text: 'Hi {{1}}, order {{2}} is ready for pickup.',
examples: {'1': 'Jane', '2': 'A1042'}
}),
footer: 'Reply STOP to opt out',
buttons: [
{
type: 'URL',
text: 'Track order',
url: 'https://shop.example.com/o/{{1}}',
urlExample: 'https://shop.example.com/o/A1042'
}
]
}
})
};
fetch('https://app.telaven.com/api/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/templates"
payload = {
"name": "order_ready",
"language": "en",
"category": "utility",
"components": {
"body": {
"text": "Hi {{1}}, order {{2}} is ready for pickup.",
"examples": {
"1": "Jane",
"2": "A1042"
}
},
"footer": "Reply STOP to opt out",
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/o/{{1}}",
"urlExample": "https://shop.example.com/o/A1042"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/templates",
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([
'name' => 'order_ready',
'language' => 'en',
'category' => 'utility',
'components' => [
'body' => [
'text' => 'Hi {{1}}, order {{2}} is ready for pickup.',
'examples' => [
'1' => 'Jane',
'2' => 'A1042'
]
],
'footer' => 'Reply STOP to opt out',
'buttons' => [
[
'type' => 'URL',
'text' => 'Track order',
'url' => 'https://shop.example.com/o/{{1}}',
'urlExample' => 'https://shop.example.com/o/A1042'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/templates");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"order_ready\",\n \"language\": \"en\",\n \"category\": \"utility\",\n \"components\": {\n \"body\": {\n \"text\": \"Hi {{1}}, order {{2}} is ready for pickup.\",\n \"examples\": {\n \"1\": \"Jane\",\n \"2\": \"A1042\"\n }\n },\n \"footer\": \"Reply STOP to opt out\",\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/o/{{1}}\",\n \"urlExample\": \"https://shop.example.com/o/A1042\"\n }\n ]\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"data": {
"id": "7d2c…",
"name": "order_ready",
"status": "pending",
"rejectionReason": null
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}