Update template
curl --request PUT \
--url https://pilotstatus.com.br/v1/templates/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"url": "https://cdn.loja.com/promo.png"
},
"body": {
"text": "Oi {{nome}}! Agora com {{desconto}} de desconto."
},
"footer": {
"text": "Promoção por tempo limitado"
},
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Quero!"
},
{
"type": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
}
]
},
"examples": {
"nome": "Maria",
"desconto": "15%",
"link": "abc123"
}
}
'import requests
url = "https://pilotstatus.com.br/v1/templates/{id}"
payload = {
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"url": "https://cdn.loja.com/promo.png"
},
"body": { "text": "Oi {{nome}}! Agora com {{desconto}} de desconto." },
"footer": { "text": "Promoção por tempo limitado" },
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Quero!"
},
{
"type": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
}
]
},
"examples": {
"nome": "Maria",
"desconto": "15%",
"link": "abc123"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'MARKETING',
language: 'pt_BR',
body: JSON.stringify({
header: {type: 'IMAGE', url: 'https://cdn.loja.com/promo.png'},
body: JSON.stringify({text: 'Oi {{nome}}! Agora com {{desconto}} de desconto.'}),
footer: {text: 'Promoção por tempo limitado'},
buttons: [
{type: 'QUICK_REPLY', text: 'Quero!'},
{type: 'URL', text: 'Comprar', url: 'https://loja.com/promo/{{link}}'}
]
}),
examples: {nome: 'Maria', desconto: '15%', link: 'abc123'}
})
};
fetch('https://pilotstatus.com.br/v1/templates/{id}', 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://pilotstatus.com.br/v1/templates/{id}",
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([
'category' => 'MARKETING',
'language' => 'pt_BR',
'body' => [
'header' => [
'type' => 'IMAGE',
'url' => 'https://cdn.loja.com/promo.png'
],
'body' => [
'text' => 'Oi {{nome}}! Agora com {{desconto}} de desconto.'
],
'footer' => [
'text' => 'Promoção por tempo limitado'
],
'buttons' => [
[
'type' => 'QUICK_REPLY',
'text' => 'Quero!'
],
[
'type' => 'URL',
'text' => 'Comprar',
'url' => 'https://loja.com/promo/{{link}}'
]
]
],
'examples' => [
'nome' => 'Maria',
'desconto' => '15%',
'link' => 'abc123'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/templates/{id}"
payload := strings.NewReader("{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/templates/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "tpl_01HZX...",
"name": "promo_cupom",
"category": "MARKETING",
"metaStatus": "PENDING"
}{
"code": "TEMPLATE_EXAMPLES_REQUIRED",
"details": {
"missing": [
"nome"
]
}
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}{
"error": "Too many requests"
}Authorizations
Your ps_ API key
Path Parameters
Id or name of the template to update.
Body
New template content: object { header?, body, footer?, buttons? } (recommended), the same JSON as a string, or plain text (auto-wrapped).
{ "body": { "text": "Oi {{nome}}!" } }
Optional header. TEXT: text with 0–1 variable (up to 60 chars). IMAGE/VIDEO/DOCUMENT: provide url (http/https) OR base64 (data URI); base64 is re-hosted server-side. No location header.
{
"type": "IMAGE",
"url": "https://cdn.loja.com/promo.png"
}
Optional footer, up to 60 chars, no variables.
{ "text": "Promoção por tempo limitado" }
Up to 10 buttons: QUICK_REPLY (≤ 10; text), URL (≤ 2; text + static url or dynamic with trailing {{1}}), PHONE_NUMBER (≤ 1; text + phone_number E.164), COPY_CODE (≤ 1; code in example). Quick-reply and CTA can coexist.
Show child attributes
Show child attributes
[
{ "type": "QUICK_REPLY", "text": "Quero!" },
{
"type": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
}
]
Required when variables exist: maps each variable used in body/header (and the dynamic URL) to a sample value. The COPY_CODE code goes in button.example, not here. Missing → 400 TEMPLATE_EXAMPLES_REQUIRED.
Show child attributes
Show child attributes
{
"nome": "Maria",
"desconto": "15%",
"link": "abc123"
}
Template category (default UTILITY).
"MARKETING"
Template language (default pt_BR).
"pt_BR"
Response
Update template
Was this page helpful?
curl --request PUT \
--url https://pilotstatus.com.br/v1/templates/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"url": "https://cdn.loja.com/promo.png"
},
"body": {
"text": "Oi {{nome}}! Agora com {{desconto}} de desconto."
},
"footer": {
"text": "Promoção por tempo limitado"
},
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Quero!"
},
{
"type": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
}
]
},
"examples": {
"nome": "Maria",
"desconto": "15%",
"link": "abc123"
}
}
'import requests
url = "https://pilotstatus.com.br/v1/templates/{id}"
payload = {
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"url": "https://cdn.loja.com/promo.png"
},
"body": { "text": "Oi {{nome}}! Agora com {{desconto}} de desconto." },
"footer": { "text": "Promoção por tempo limitado" },
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Quero!"
},
{
"type": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
}
]
},
"examples": {
"nome": "Maria",
"desconto": "15%",
"link": "abc123"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: 'MARKETING',
language: 'pt_BR',
body: JSON.stringify({
header: {type: 'IMAGE', url: 'https://cdn.loja.com/promo.png'},
body: JSON.stringify({text: 'Oi {{nome}}! Agora com {{desconto}} de desconto.'}),
footer: {text: 'Promoção por tempo limitado'},
buttons: [
{type: 'QUICK_REPLY', text: 'Quero!'},
{type: 'URL', text: 'Comprar', url: 'https://loja.com/promo/{{link}}'}
]
}),
examples: {nome: 'Maria', desconto: '15%', link: 'abc123'}
})
};
fetch('https://pilotstatus.com.br/v1/templates/{id}', 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://pilotstatus.com.br/v1/templates/{id}",
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([
'category' => 'MARKETING',
'language' => 'pt_BR',
'body' => [
'header' => [
'type' => 'IMAGE',
'url' => 'https://cdn.loja.com/promo.png'
],
'body' => [
'text' => 'Oi {{nome}}! Agora com {{desconto}} de desconto.'
],
'footer' => [
'text' => 'Promoção por tempo limitado'
],
'buttons' => [
[
'type' => 'QUICK_REPLY',
'text' => 'Quero!'
],
[
'type' => 'URL',
'text' => 'Comprar',
'url' => 'https://loja.com/promo/{{link}}'
]
]
],
'examples' => [
'nome' => 'Maria',
'desconto' => '15%',
'link' => 'abc123'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/templates/{id}"
payload := strings.NewReader("{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/templates/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"url\": \"https://cdn.loja.com/promo.png\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Agora com {{desconto}} de desconto.\"\n },\n \"footer\": {\n \"text\": \"Promoção por tempo limitado\"\n },\n \"buttons\": [\n {\n \"type\": \"QUICK_REPLY\",\n \"text\": \"Quero!\"\n },\n {\n \"type\": \"URL\",\n \"text\": \"Comprar\",\n \"url\": \"https://loja.com/promo/{{link}}\"\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"15%\",\n \"link\": \"abc123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "tpl_01HZX...",
"name": "promo_cupom",
"category": "MARKETING",
"metaStatus": "PENDING"
}{
"code": "TEMPLATE_EXAMPLES_REQUIRED",
"details": {
"missing": [
"nome"
]
}
}{
"error": "Unauthorized"
}{
"error": "Tenant-scoped keys cannot call number endpoints",
"code": "TENANT_SCOPE_NOT_ALLOWED"
}{
"error": "Too many requests"
}