Edit template
curl --request PUT \
--url https://api.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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"
}{
"error": {
"errors": [
{
"code": "100",
"name": "META_WHATSAPP_ERROR",
"subCode": "2388024",
"message": "Invalid parameter",
"description": "There is already English (US) content for this template. You can create a new template and try again."
}
]
}
}Templates (WhatsApp)
Update template
Update an existing template and resubmit for approval
PUT
/
whatsapp
/
businesses
/
{wabaId}
/
templates
/
{templateId}
Edit template
curl --request PUT \
--url https://api.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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.omni.z-api.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"
}{
"error": {
"errors": [
{
"code": "100",
"name": "META_WHATSAPP_ERROR",
"subCode": "2388024",
"message": "Invalid parameter",
"description": "There is already English (US) content for this template. You can create a new template and try again."
}
]
}
}Overview
Updates an existing template and resubmits it for Meta approval. The body is the same used when creating the template.When updating 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 Omni Z-API 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