Edit template
curl --request PUT \
--url https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}.",
"example": {
"body_text": [
[
"Ana",
"ORD-1024",
"in transit"
]
]
}
}
]
}
'import requests
url = "https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
payload = {
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}.",
"example": { "body_text": [["Ana", "ORD-1024", "in transit"]] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'order_update_v1',
category: 'UTILITY',
language: 'en_US',
components: [
{
type: 'BODY',
text: 'Hello {{1}}, your order {{2}} has been updated to {{3}}.',
example: {body_text: [['Ana', 'ORD-1024', 'in transit']]}
}
]
})
};
fetch('https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}', 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.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'order_update_v1',
'category' => 'UTILITY',
'language' => 'en_US',
'components' => [
[
'type' => 'BODY',
'text' => 'Hello {{1}}, your order {{2}} has been updated to {{3}}.',
'example' => [
'body_text' => [
[
'Ana',
'ORD-1024',
'in transit'
]
]
]
]
]
]),
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://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "Newport request failed",
"value": {
"errors": [
{
"description": "",
"name": "META_WHATSAPP_ERROR",
"message": "Your message could not be sent because it contains content that other people on Facebook have reported as abusive.",
"code": "368"
}
]
}
}{
"error": 401,
"message": "Unauthorized"
}Templates
Edit template
Edit an existing template and resubmit for approval
PUT
/
whatsapp
/
businesses
/
{wabaId}
/
templates
/
{templateId}
Edit template
curl --request PUT \
--url https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}.",
"example": {
"body_text": [
[
"Ana",
"ORD-1024",
"in transit"
]
]
}
}
]
}
'import requests
url = "https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
payload = {
"name": "order_update_v1",
"category": "UTILITY",
"language": "en_US",
"components": [
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} has been updated to {{3}}.",
"example": { "body_text": [["Ana", "ORD-1024", "in transit"]] }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'order_update_v1',
category: 'UTILITY',
language: 'en_US',
components: [
{
type: 'BODY',
text: 'Hello {{1}}, your order {{2}} has been updated to {{3}}.',
example: {body_text: [['Ana', 'ORD-1024', 'in transit']]}
}
]
})
};
fetch('https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}', 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.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'order_update_v1',
'category' => 'UTILITY',
'language' => 'en_US',
'components' => [
[
'type' => 'BODY',
'text' => 'Hello {{1}}, your order {{2}} has been updated to {{3}}.',
'example' => [
'body_text' => [
[
'Ana',
'ORD-1024',
'in transit'
]
]
]
]
]
]),
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://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubmessage.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"order_update_v1\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"components\": [\n {\n \"type\": \"BODY\",\n \"text\": \"Hello {{1}}, your order {{2}} has been updated to {{3}}.\",\n \"example\": {\n \"body_text\": [\n [\n \"Ana\",\n \"ORD-1024\",\n \"in transit\"\n ]\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "Newport request failed",
"value": {
"errors": [
{
"description": "",
"name": "META_WHATSAPP_ERROR",
"message": "Your message could not be sent because it contains content that other people on Facebook have reported as abusive.",
"code": "368"
}
]
}
}{
"error": 401,
"message": "Unauthorized"
}Overview
Edits an existing template and resubmits it for Meta approval. The body is the same used when creating the template.When editing an approved template, it goes back to
PENDING status until Meta reviews it again.The
templateId is obtained from the List templates endpoint.Authorizations
Secret Key generated in the Hub Message Security panel
Path Parameters
WABA ID (obtained via List WABAs)
Example:
"428083093730937"
Template ID (obtained via List templates)
Example:
"1900296177408890"
Body
application/json
Response
Template edited successfully
Indicates whether the operation was successful
⌘I