Update template
curl --request PATCH \
--url https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"format": "text",
"type": "header"
}
]
}
'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}"
payload = { "components": [
{
"format": "text",
"type": "header"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({components: [{format: 'text', type: 'header'}]})
};
fetch('https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}', 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.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'format' => 'text',
'type' => 'header'
]
]
]),
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.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}"
payload := strings.NewReader("{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"template": {
"id": "<string>",
"language": "<string>",
"name": "<string>",
"status": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}AIsa Messaging
Update template
WhatsApp. Update one variant’s components and/or its message_send_ttl_seconds. Name, language and category cannot change after creation.
Choosing the variant
Meta stores one template per name + language, so a name identifies a family of variants, each with its own Meta id. Pass language to address one variant.
- Without
language, a name with a single variant resolves to that variant. A name with several returns409 ambiguous_templatewithdetails.languages. - A bare language (es) matches a single regional variant (es_ES).
A write: needs messaging:write and is audited.
PATCH
https://api.aisa.one
/
apis
/
v1
/
social
/
messaging
/
whatsapp
/
templates
/
{templateName}
Update template
curl --request PATCH \
--url https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"components": [
{
"format": "text",
"type": "header"
}
]
}
'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}"
payload = { "components": [
{
"format": "text",
"type": "header"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({components: [{format: 'text', type: 'header'}]})
};
fetch('https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}', 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.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'components' => [
[
'format' => 'text',
'type' => 'header'
]
]
]),
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.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}"
payload := strings.NewReader("{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"components\": [\n {\n \"format\": \"text\",\n \"type\": \"header\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"template": {
"id": "<string>",
"language": "<string>",
"name": "<string>",
"status": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: PATCH /apis/v1/social/messaging/whatsapp/templates/{templateName}
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/social/messaging/whatsapp/templates/{templateName} - templateName: path; required
- connectionId: query; required
{
"operationId": "patch_aisa_messaging_apis_v1_social_messaging_wha_63f36d",
"method": "PATCH",
"path": "/apis/v1/social/messaging/whatsapp/templates/{templateName}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Template name (the family).",
"in": "path",
"name": "templateName",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"components": [
{
"format": "text",
"type": "header"
}
],
"language": "example"
},
"schema": {
"additionalProperties": false,
"properties": {
"components": {
"description": "Updated template components. Optional when only message_send_ttl_seconds changes; at least one of the two is required.",
"items": {
"oneOf": [
{
"properties": {
"example": {
"properties": {
"header_handle": {
"description": "When the header format is a media type (image, video, gif, document), provide a public URL here.",
"items": {
"format": "uri",
"type": "string"
},
"maxItems": 1,
"minItems": 1,
"type": "array"
},
"header_text": {
"description": "Sample values for header text variables",
"items": {
"type": "string"
},
"type": "array"
},
"header_text_named_params": {
"description": "Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).",
"items": {
"properties": {
"example": {
"description": "Sample value for this variable.",
"type": "string"
},
"param_name": {
"description": "Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).",
"pattern": "^[a-z0-9_]+$",
"type": "string"
}
},
"required": [
"param_name",
"example"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"format": {
"enum": [
"text",
"image",
"video",
"gif",
"document",
"location"
],
"type": "string"
},
"text": {
"description": "Header text (may include {{1}} variable). Used when format is TEXT.",
"type": "string"
},
"type": {
"enum": [
"header"
],
"type": "string"
}
},
"required": [
"type",
"format"
],
"type": "object"
},
{
"properties": {
"add_security_recommendation": {
"description": "Add security recommendation text (authentication templates only)",
"type": "boolean"
},
"example": {
"properties": {
"body_text": {
"description": "Sample values for body variables (array of arrays)",
"items": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "array"
},
"body_text_named_params": {
"description": "Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).",
"items": {
"properties": {
"example": {
"description": "Sample value for this variable.",
"type": "string"
},
"param_name": {
"description": "Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).",
"pattern": "^[a-z0-9_]+$",
"type": "string"
}
},
"required": [
"param_name",
"example"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"text": {
"description": "Body text with optional {{n}} variables",
"type": "string"
},
"type": {
"enum": [
"body"
],
"type": "string"
}
},
"required": [
"type",
"text"
],
"type": "object"
},
{
"properties": {
"code_expiration_minutes": {
"description": "OTP code expiry in minutes (authentication templates only)",
"minimum": 1,
"type": "integer"
},
"text": {
"description": "Static footer text",
"type": "string"
},
"type": {
"enum": [
"footer"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"buttons": {
"items": {
"properties": {
"autofill_text": {
"type": "string"
},
"example": {
"description": "Example value(s). Accepts either a string or an array of strings. For URL buttons, an array of URL-suffix samples; for copy_code (marketing) buttons, the coupon code as a single string. Left untyped (string | string[]) on purpose: a typed oneOf of string-vs-array breaks several SDK code generators."
},
"flow_action": {
"type": "string"
},
"flow_id": {
"type": "string"
},
"flow_json": {
"type": "string"
},
"flow_name": {
"type": "string"
},
"navigate_screen": {
"type": "string"
},
"otp_type": {
"description": "Required when type is otp",
"enum": [
"copy_code",
"one_tap",
"zero_tap"
],
"type": "string"
},
"package_name": {
"type": "string"
},
"phone_number": {
"description": "Required when type is phone_number",
"type": "string"
},
"signature_hash": {
"type": "string"
},
"text": {
"description": "Visible button label. Required for all types except copy_code (whose label is fixed by WhatsApp) and otp (omit it and WhatsApp supplies its own label, localized to the template language; an English label on a non-English template is rejected).",
"type": "string"
},
"type": {
"enum": [
"quick_reply",
"url",
"phone_number",
"otp",
"copy_code",
"flow",
"mpm",
"catalog"
],
"type": "string"
},
"url": {
"description": "Required when type is URL",
"format": "uri",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"type": {
"enum": [
"buttons"
],
"type": "string"
}
},
"required": [
"type",
"buttons"
],
"type": "object"
},
{
"properties": {
"cards": {
"description": "2-10 cards. Meta requires all cards to share the same component structure; a mismatch surfaces as a rejected_reason. MARKETING category only.",
"items": {
"properties": {
"components": {
"description": "Per-card components. Each card carries its own media header + optional body + up to 2 buttons. Footer and nested carousel are not allowed inside cards.",
"items": {
"oneOf": [
{
"properties": {
"example": {
"properties": {
"header_handle": {
"description": "When the header format is a media type (image, video, gif, document), provide a public URL here.",
"items": {
"format": "uri",
"type": "string"
},
"maxItems": 1,
"minItems": 1,
"type": "array"
},
"header_text": {
"description": "Sample values for header text variables",
"items": {
"type": "string"
},
"type": "array"
},
"header_text_named_params": {
"description": "Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).",
"items": {
"properties": {
"example": {
"description": "Sample value for this variable.",
"type": "string"
},
"param_name": {
"description": "Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).",
"pattern": "^[a-z0-9_]+$",
"type": "string"
}
},
"required": [
"param_name",
"example"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"format": {
"enum": [
"text",
"image",
"video",
"gif",
"document",
"location"
],
"type": "string"
},
"text": {
"description": "Header text (may include {{1}} variable). Used when format is TEXT.",
"type": "string"
},
"type": {
"enum": [
"header"
],
"type": "string"
}
},
"required": [
"type",
"format"
],
"type": "object"
},
{
"properties": {
"add_security_recommendation": {
"description": "Add security recommendation text (authentication templates only)",
"type": "boolean"
},
"example": {
"properties": {
"body_text": {
"description": "Sample values for body variables (array of arrays)",
"items": {
"items": {
"type": "string"
},
"type": "array"
},
"type": "array"
},
"body_text_named_params": {
"description": "Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).",
"items": {
"properties": {
"example": {
"description": "Sample value for this variable.",
"type": "string"
},
"param_name": {
"description": "Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).",
"pattern": "^[a-z0-9_]+$",
"type": "string"
}
},
"required": [
"param_name",
"example"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"text": {
"description": "Body text with optional {{n}} variables",
"type": "string"
},
"type": {
"enum": [
"body"
],
"type": "string"
}
},
"required": [
"type",
"text"
],
"type": "object"
},
{
"properties": {
"buttons": {
"items": {
"properties": {
"autofill_text": {
"type": "string"
},
"example": {
"description": "Example value(s). Accepts either a string or an array of strings. For URL buttons, an array of URL-suffix samples; for copy_code (marketing) buttons, the coupon code as a single string. Left untyped (string | string[]) on purpose: a typed oneOf of string-vs-array breaks several SDK code generators."
},
"flow_action": {
"type": "string"
},
"flow_id": {
"type": "string"
},
"flow_json": {
"type": "string"
},
"flow_name": {
"type": "string"
},
"navigate_screen": {
"type": "string"
},
"otp_type": {
"description": "Required when type is otp",
"enum": [
"copy_code",
"one_tap",
"zero_tap"
],
"type": "string"
},
"package_name": {
"type": "string"
},
"phone_number": {
"description": "Required when type is phone_number",
"type": "string"
},
"signature_hash": {
"type": "string"
},
"text": {
"description": "Visible button label. Required for all types except copy_code (whose label is fixed by WhatsApp) and otp (omit it and WhatsApp supplies its own label, localized to the template language; an English label on a non-English template is rejected).",
"type": "string"
},
"type": {
"enum": [
"quick_reply",
"url",
"phone_number",
"otp",
"copy_code",
"flow",
"mpm",
"catalog"
],
"type": "string"
},
"url": {
"description": "Required when type is URL",
"format": "uri",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"type": {
"enum": [
"buttons"
],
"type": "string"
}
},
"required": [
"type",
"buttons"
],
"type": "object"
}
]
},
"minItems": 1,
"type": "array"
}
},
"required": [
"components"
],
"type": "object"
},
"maxItems": 10,
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"carousel"
],
"type": "string"
}
},
"required": [
"type",
"cards"
],
"type": "object"
},
{
"properties": {
"limited_time_offer": {
"properties": {
"has_expiration": {
"description": "Toggles the countdown timer. The actual coupon code + expiry are bound at SEND time, not here.",
"type": "boolean"
},
"text": {
"description": "Short offer label (<=16 chars). MARKETING only.",
"maxLength": 16,
"minLength": 1,
"type": "string"
}
},
"required": [
"text"
],
"type": "object"
},
"type": {
"enum": [
"limited_time_offer"
],
"type": "string"
}
},
"required": [
"type",
"limited_time_offer"
],
"type": "object"
}
]
},
"minItems": 1,
"type": "array"
},
"connectionId": {
"description": "The connection, when not sent as the connectionId query parameter.",
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
},
"language": {
"description": "Language code of the variant to edit (e.g. en_US, es, pt_BR). Required when the family has several languages. Body only: a language query parameter on PATCH is a 400.",
"type": "string"
},
"message_send_ttl_seconds": {
"description": "Delivery validity window in seconds: a message not delivered within it is dropped. Range by category:\n\n- AUTHENTICATION: 30 to 900. - UTILITY: 30 to 43200 (12h). - MARKETING: 43200 to 2592000 (30 days).\n\n-1 is not accepted here (Meta treats it as an empty edit); send a value in range. Meta defaults to 600 for AUTHENTICATION and 30 days otherwise.\n\nA TTL-only edit keeps an APPROVED template approved, no re-review. If Meta later recategorises the template, it clears the TTL (read it back to check).",
"type": "integer"
}
},
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation.Authorizations
Query Parameters
Body
application/json
Delivery validity window in seconds: a message not delivered within it is dropped. Range by category:
- AUTHENTICATION: 30 to 900. - UTILITY: 30 to 43200 (12h). - MARKETING: 43200 to 2592000 (30 days).
-1 is not accepted here (Meta treats it as an empty edit); send a value in range. Meta defaults to 600 for AUTHENTICATION and 30 days otherwise.
A TTL-only edit keeps an APPROVED template approved, no re-review. If Meta later recategorises the template, it clears the TTL (read it back to check).