Create template
curl --request POST \
--url https://pilotstatus.com.br/v1/templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "promo_cupom",
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"base64": "data:image/png;base64,..."
},
"body": {
"text": "Oi {{nome}}! Use e ganhe {{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}}"
},
{
"type": "PHONE_NUMBER",
"text": "Falar",
"phone_number": "+5511999998888"
},
{
"type": "COPY_CODE",
"example": [
"PROMO10"
]
}
]
},
"examples": {
"nome": "Maria",
"desconto": "10%",
"link": "abc123"
}
}
'import requests
url = "https://pilotstatus.com.br/v1/templates"
payload = {
"name": "promo_cupom",
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"base64": "data:image/png;base64,..."
},
"body": { "text": "Oi {{nome}}! Use e ganhe {{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}}"
},
{
"type": "PHONE_NUMBER",
"text": "Falar",
"phone_number": "+5511999998888"
},
{
"type": "COPY_CODE",
"example": ["PROMO10"]
}
]
},
"examples": {
"nome": "Maria",
"desconto": "10%",
"link": "abc123"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'promo_cupom',
category: 'MARKETING',
language: 'pt_BR',
body: JSON.stringify({
header: {type: 'IMAGE', base64: 'data:image/png;base64,...'},
body: JSON.stringify({text: 'Oi {{nome}}! Use e ganhe {{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}}'},
{type: 'PHONE_NUMBER', text: 'Falar', phone_number: '+5511999998888'},
{type: 'COPY_CODE', example: ['PROMO10']}
]
}),
examples: {nome: 'Maria', desconto: '10%', link: 'abc123'}
})
};
fetch('https://pilotstatus.com.br/v1/templates', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'promo_cupom',
'category' => 'MARKETING',
'language' => 'pt_BR',
'body' => [
'header' => [
'type' => 'IMAGE',
'base64' => 'data:image/png;base64,...'
],
'body' => [
'text' => 'Oi {{nome}}! Use e ganhe {{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}}'
],
[
'type' => 'PHONE_NUMBER',
'text' => 'Falar',
'phone_number' => '+5511999998888'
],
[
'type' => 'COPY_CODE',
'example' => [
'PROMO10'
]
]
]
],
'examples' => [
'nome' => 'Maria',
'desconto' => '10%',
'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"
payload := strings.NewReader("{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\n \"link\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/templates")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\n \"link\": \"abc123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\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
Body
Template name (letters/numbers only; separators become _).
"promo_cupom"
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",
"base64": "data:image/png;base64,..."
}
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": "URL",
"text": "Comprar",
"url": "https://loja.com/promo/{{link}}"
},
{
"type": "COPY_CODE",
"example": ["PROMO10"]
}
]
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": "10%",
"link": "abc123"
}
Template category (default UTILITY).
"MARKETING"
Template language (default pt_BR).
"pt_BR"
Response
Create full template
Was this page helpful?
curl --request POST \
--url https://pilotstatus.com.br/v1/templates \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "promo_cupom",
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"base64": "data:image/png;base64,..."
},
"body": {
"text": "Oi {{nome}}! Use e ganhe {{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}}"
},
{
"type": "PHONE_NUMBER",
"text": "Falar",
"phone_number": "+5511999998888"
},
{
"type": "COPY_CODE",
"example": [
"PROMO10"
]
}
]
},
"examples": {
"nome": "Maria",
"desconto": "10%",
"link": "abc123"
}
}
'import requests
url = "https://pilotstatus.com.br/v1/templates"
payload = {
"name": "promo_cupom",
"category": "MARKETING",
"language": "pt_BR",
"body": {
"header": {
"type": "IMAGE",
"base64": "data:image/png;base64,..."
},
"body": { "text": "Oi {{nome}}! Use e ganhe {{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}}"
},
{
"type": "PHONE_NUMBER",
"text": "Falar",
"phone_number": "+5511999998888"
},
{
"type": "COPY_CODE",
"example": ["PROMO10"]
}
]
},
"examples": {
"nome": "Maria",
"desconto": "10%",
"link": "abc123"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'promo_cupom',
category: 'MARKETING',
language: 'pt_BR',
body: JSON.stringify({
header: {type: 'IMAGE', base64: 'data:image/png;base64,...'},
body: JSON.stringify({text: 'Oi {{nome}}! Use e ganhe {{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}}'},
{type: 'PHONE_NUMBER', text: 'Falar', phone_number: '+5511999998888'},
{type: 'COPY_CODE', example: ['PROMO10']}
]
}),
examples: {nome: 'Maria', desconto: '10%', link: 'abc123'}
})
};
fetch('https://pilotstatus.com.br/v1/templates', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'promo_cupom',
'category' => 'MARKETING',
'language' => 'pt_BR',
'body' => [
'header' => [
'type' => 'IMAGE',
'base64' => 'data:image/png;base64,...'
],
'body' => [
'text' => 'Oi {{nome}}! Use e ganhe {{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}}'
],
[
'type' => 'PHONE_NUMBER',
'text' => 'Falar',
'phone_number' => '+5511999998888'
],
[
'type' => 'COPY_CODE',
'example' => [
'PROMO10'
]
]
]
],
'examples' => [
'nome' => 'Maria',
'desconto' => '10%',
'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"
payload := strings.NewReader("{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\n \"link\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/templates")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\n \"link\": \"abc123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"promo_cupom\",\n \"category\": \"MARKETING\",\n \"language\": \"pt_BR\",\n \"body\": {\n \"header\": {\n \"type\": \"IMAGE\",\n \"base64\": \"data:image/png;base64,...\"\n },\n \"body\": {\n \"text\": \"Oi {{nome}}! Use e ganhe {{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 \"type\": \"PHONE_NUMBER\",\n \"text\": \"Falar\",\n \"phone_number\": \"+5511999998888\"\n },\n {\n \"type\": \"COPY_CODE\",\n \"example\": [\n \"PROMO10\"\n ]\n }\n ]\n },\n \"examples\": {\n \"nome\": \"Maria\",\n \"desconto\": \"10%\",\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"
}