WhatsApp · WhatsApp
Updates a template by id. Fields you leave out keep their current values.
https://api.pozy.ai/v1/whatsapp/templates/id/{templateId}Guide: Message templates
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the accounts resource group disabled get 403 resource_group_disabled. Authentication
Path parameters
| Name | Type | Notes |
|---|---|---|
templateIdrequired | string |
Request body
application/json, required
accountIdstringrequiredcomponentsarray of objectAt least 1 item.
One of:
Whats App Header Component (4 fields)
typestringrequiredOne of
header.formatstringrequiredOne of
text,image,video,gif,document,location.textstringexampleobject3 child fields
header_textarray of stringheader_text_named_paramsarray of object2 child fields
param_namestringrequiredMatches
^[a-z0-9_]+$.examplestringrequired
header_handlearray of string (URL)At least 1 item. Up to 1 items.
Whats App Body Component (4 fields)
typestringrequiredOne of
body.textstringrequiredadd_security_recommendationbooleanexampleobject2 child fields
body_textarray of array of stringbody_text_named_paramsarray of object2 child fields
param_namestringrequiredMatches
^[a-z0-9_]+$.examplestringrequired
Whats App Footer Component (3 fields)
typestringrequiredOne of
footer.textstringcode_expiration_minutesintegerAt least 1.
Whats App Buttons Component (2 fields)
typestringrequiredOne of
buttons.buttonsarray of objectrequiredAt least 1 item.
14 child fields
typestringrequiredOne of
quick_reply,url,phone_number,otp,copy_code,flow,mpm,catalog.textstringurlstring (URL)exampleanyphone_numberstringotp_typestringOne of
copy_code,one_tap,zero_tap.autofill_textstringpackage_namestringsignature_hashstringflow_idstringflow_namestringflow_jsonstringflow_actionstringnavigate_screenstring
Whats App Carousel Component (2 fields)
typestringrequiredOne of
carousel.cardsarray of objectrequiredAt least 2 items. Up to 10 items.
1 child field
componentsarray of objectrequiredAt least 1 item.
One of:
Whats App Header Component (4 fields)
typestringrequiredOne of
header.formatstringrequiredOne of
text,image,video,gif,document,location.textstringexampleobject3 child fields
header_textarray of stringheader_text_named_paramsarray of object2 child fields
param_namestringrequiredMatches
^[a-z0-9_]+$.examplestringrequired
header_handlearray of string (URL)At least 1 item. Up to 1 items.
Whats App Body Component (4 fields)
typestringrequiredOne of
body.textstringrequiredadd_security_recommendationbooleanexampleobject2 child fields
body_textarray of array of stringbody_text_named_paramsarray of object2 child fields
param_namestringrequiredMatches
^[a-z0-9_]+$.examplestringrequired
Whats App Buttons Component (2 fields)
typestringrequiredOne of
buttons.buttonsarray of objectrequiredAt least 1 item.
14 child fields
typestringrequiredOne of
quick_reply,url,phone_number,otp,copy_code,flow,mpm,catalog.textstringurlstring (URL)exampleanyphone_numberstringotp_typestringOne of
copy_code,one_tap,zero_tap.autofill_textstringpackage_namestringsignature_hashstringflow_idstringflow_namestringflow_jsonstringflow_actionstringnavigate_screenstring
Whats App Limited Time Offer Component (2 fields)
typestringrequiredOne of
limited_time_offer.limited_time_offerobjectrequired2 child fields
textstringrequired1 to 16 characters.
has_expirationboolean
message_send_ttl_secondsinteger
Example
curl -X PATCH "https://api.pozy.ai/v1/whatsapp/templates/id/68fc85b3d7dcabf758aa29d2" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "696e0b682d0a31188e7a2ba9"
}'const res = await fetch("https://api.pozy.ai/v1/whatsapp/templates/id/68fc85b3d7dcabf758aa29d2", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
accountId: "696e0b682d0a31188e7a2ba9"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.patch(
"https://api.pozy.ai/v1/whatsapp/templates/id/68fc85b3d7dcabf758aa29d2",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"accountId": "696e0b682d0a31188e7a2ba9",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
200 on success
successbooleantemplateobjectidstringnamestringlanguagestringstatusstring
{
"success": true,
"template": {
"id": "6bfebd43ddc270f6d2c56fc5",
"name": "Acme",
"language": "en",
"status": "active"
}
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 404 | not_found | Nothing with that id exists in your workspace. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.