Templates
Create Template
Creates a WhatsApp message template and sends it to Meta for approval.
POST
/
api
/
v1
/
templates
Create Template
curl --request POST \
--url https://app.chatflows.io/api/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 1,
"name": "order_confirmation",
"language": "en_US",
"category": "UTILITY",
"header": {
"format": "TEXT",
"text": "Order update"
},
"body": "Your order {{1}} has shipped.",
"footer": "Thanks for shopping with us",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Track order"
},
{
"type": "URL",
"text": "Shop again",
"url": "https://example.com"
}
]
}
'import requests
url = "https://app.chatflows.io/api/v1/templates"
payload = {
"channel_id": 1,
"name": "order_confirmation",
"language": "en_US",
"category": "UTILITY",
"header": {
"format": "TEXT",
"text": "Order update"
},
"body": "Your order {{1}} has shipped.",
"footer": "Thanks for shopping with us",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Track order"
},
{
"type": "URL",
"text": "Shop again",
"url": "https://example.com"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel_id: 1,
name: 'order_confirmation',
language: 'en_US',
category: 'UTILITY',
header: {format: 'TEXT', text: 'Order update'},
body: JSON.stringify('Your order {{1}} has shipped.'),
footer: 'Thanks for shopping with us',
buttons: [
{type: 'QUICK_REPLY', text: 'Track order'},
{type: 'URL', text: 'Shop again', url: 'https://example.com'}
]
})
};
fetch('https://app.chatflows.io/api/v1/templates', 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://app.chatflows.io/api/v1/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([
'channel_id' => 1,
'name' => 'order_confirmation',
'language' => 'en_US',
'category' => 'UTILITY',
'header' => [
'format' => 'TEXT',
'text' => 'Order update'
],
'body' => 'Your order {{1}} has shipped.',
'footer' => 'Thanks for shopping with us',
'buttons' => [
[
'type' => 'QUICK_REPLY',
'text' => 'Track order'
],
[
'type' => 'URL',
'text' => 'Shop again',
'url' => 'https://example.com'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.chatflows.io/api/v1/templates"
payload := strings.NewReader("{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.chatflows.io/api/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatflows.io/api/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"channel_id": 1,
"platform": "whatsapp",
"platform_template_id": "987654321",
"name": "order_confirmation",
"language": "en_US",
"category": "utility",
"sub_type": null,
"status": "PENDING",
"quality_rating": null,
"components": [
{
"type": "BODY",
"text": "Your order {{1}} has shipped."
},
{
"type": "FOOTER",
"text": "Thanks for shopping with us"
}
],
"example_values": {
"body": [
"#A123"
]
},
"rejected_reason": null,
"last_synced_at": "2026-06-27T09:00:00+00:00",
"created_at": "2026-06-27T09:00:00+00:00",
"updated_at": "2026-06-27T09:00:00+00:00"
}
}The new template starts as
PENDING. Meta then approves or rejects it, which can take some time. Check the result with Get Template.
Returns 422 with meta_rejected if Meta refuses the template straight away, for example because the name is already used.Authorizations
Body
application/json
⌘I
Create Template
curl --request POST \
--url https://app.chatflows.io/api/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 1,
"name": "order_confirmation",
"language": "en_US",
"category": "UTILITY",
"header": {
"format": "TEXT",
"text": "Order update"
},
"body": "Your order {{1}} has shipped.",
"footer": "Thanks for shopping with us",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Track order"
},
{
"type": "URL",
"text": "Shop again",
"url": "https://example.com"
}
]
}
'import requests
url = "https://app.chatflows.io/api/v1/templates"
payload = {
"channel_id": 1,
"name": "order_confirmation",
"language": "en_US",
"category": "UTILITY",
"header": {
"format": "TEXT",
"text": "Order update"
},
"body": "Your order {{1}} has shipped.",
"footer": "Thanks for shopping with us",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Track order"
},
{
"type": "URL",
"text": "Shop again",
"url": "https://example.com"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel_id: 1,
name: 'order_confirmation',
language: 'en_US',
category: 'UTILITY',
header: {format: 'TEXT', text: 'Order update'},
body: JSON.stringify('Your order {{1}} has shipped.'),
footer: 'Thanks for shopping with us',
buttons: [
{type: 'QUICK_REPLY', text: 'Track order'},
{type: 'URL', text: 'Shop again', url: 'https://example.com'}
]
})
};
fetch('https://app.chatflows.io/api/v1/templates', 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://app.chatflows.io/api/v1/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([
'channel_id' => 1,
'name' => 'order_confirmation',
'language' => 'en_US',
'category' => 'UTILITY',
'header' => [
'format' => 'TEXT',
'text' => 'Order update'
],
'body' => 'Your order {{1}} has shipped.',
'footer' => 'Thanks for shopping with us',
'buttons' => [
[
'type' => 'QUICK_REPLY',
'text' => 'Track order'
],
[
'type' => 'URL',
'text' => 'Shop again',
'url' => 'https://example.com'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.chatflows.io/api/v1/templates"
payload := strings.NewReader("{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.chatflows.io/api/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatflows.io/api/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_id\": 1,\n \"name\": \"order_confirmation\",\n \"language\": \"en_US\",\n \"category\": \"UTILITY\",\n \"header\": {\n \"format\": \"TEXT\",\n \"text\": \"Order update\"\n },\n \"body\": \"Your order {{1}} has shipped.\",\n \"footer\": \"Thanks for shopping with us\",\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Track order\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Shop again\",\n \"url\": \"https://example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"channel_id": 1,
"platform": "whatsapp",
"platform_template_id": "987654321",
"name": "order_confirmation",
"language": "en_US",
"category": "utility",
"sub_type": null,
"status": "PENDING",
"quality_rating": null,
"components": [
{
"type": "BODY",
"text": "Your order {{1}} has shipped."
},
{
"type": "FOOTER",
"text": "Thanks for shopping with us"
}
],
"example_values": {
"body": [
"#A123"
]
},
"rejected_reason": null,
"last_synced_at": "2026-06-27T09:00:00+00:00",
"created_at": "2026-06-27T09:00:00+00:00",
"updated_at": "2026-06-27T09:00:00+00:00"
}
}
