curl --request POST \
--url https://api.routa.chat/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "utility",
"body_text": "Olá {{1}}! Seu pedido {{2}} foi confirmado."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
name: 'confirmacao_pedido',
language: 'pt_BR',
category: 'utility',
body_text: 'Olá {{1}}! Seu pedido {{2}} foi confirmado.'
})
};
fetch('https://api.routa.chat/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/templates"
payload = {
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "utility",
"body_text": "Olá {{1}}! Seu pedido {{2}} foi confirmado."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/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([
'channel' => 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
'name' => 'confirmacao_pedido',
'language' => 'pt_BR',
'category' => 'utility',
'body_text' => 'Olá {{1}}! Seu pedido {{2}} foi confirmado.'
]),
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.routa.chat/v1/templates"
payload := strings.NewReader("{\n \"channel\": \"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ\",\n \"name\": \"confirmacao_pedido\",\n \"language\": \"pt_BR\",\n \"category\": \"utility\",\n \"body_text\": \"Olá {{1}}! Seu pedido {{2}} foi confirmado.\"\n}")
req, _ := http.NewRequest("POST", 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))
}{
"id": "tmpl_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "marketing",
"variables": [
{
"index": 123
}
],
"status": "draft",
"rejection_reason": "abusive_content",
"created_at": "2026-09-04T13:22:41.031Z",
"updated_at": "2026-09-04T13:22:41.031Z",
"components": {
"header": {
"kind": "text",
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"buttons": [
{
"kind": "quick_reply",
"text": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}Submeter template
Cria um template e o envia ao WhatsApp para aprovação. A aprovação é decidida pelo provedor, no tempo dele. Acompanhe pelos eventos template.* ou consultando o template.
Somente templates approved podem ser usados em POST /v1/messages. Veja Templates.
curl --request POST \
--url https://api.routa.chat/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "utility",
"body_text": "Olá {{1}}! Seu pedido {{2}} foi confirmado."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
name: 'confirmacao_pedido',
language: 'pt_BR',
category: 'utility',
body_text: 'Olá {{1}}! Seu pedido {{2}} foi confirmado.'
})
};
fetch('https://api.routa.chat/v1/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/templates"
payload = {
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "utility",
"body_text": "Olá {{1}}! Seu pedido {{2}} foi confirmado."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/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([
'channel' => 'chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ',
'name' => 'confirmacao_pedido',
'language' => 'pt_BR',
'category' => 'utility',
'body_text' => 'Olá {{1}}! Seu pedido {{2}} foi confirmado.'
]),
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.routa.chat/v1/templates"
payload := strings.NewReader("{\n \"channel\": \"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ\",\n \"name\": \"confirmacao_pedido\",\n \"language\": \"pt_BR\",\n \"category\": \"utility\",\n \"body_text\": \"Olá {{1}}! Seu pedido {{2}} foi confirmado.\"\n}")
req, _ := http.NewRequest("POST", 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))
}{
"id": "tmpl_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"channel": "chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"name": "confirmacao_pedido",
"language": "pt_BR",
"category": "marketing",
"variables": [
{
"index": 123
}
],
"status": "draft",
"rejection_reason": "abusive_content",
"created_at": "2026-09-04T13:22:41.031Z",
"updated_at": "2026-09-04T13:22:41.031Z",
"components": {
"header": {
"kind": "text",
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"buttons": [
{
"kind": "quick_reply",
"text": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "<string>",
"doc_url": "<string>",
"details": {}
}
}Authorizations
Chave de API do projeto, no formato rt_live_... ou rt_test_..., enviada como Authorization: Bearer <chave>.
Body
Canal ao qual o template pertence (chan_...).
"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ"
Nome do template.
"confirmacao_pedido"
Código de idioma, por exemplo pt_BR ou en_US.
"pt_BR"
Categoria do template: marketing, utility ou authentication.
marketing, utility, authentication Corpo do template, com placeholders posicionais {{1}}, {{2}}, …
"Olá {{1}}! Seu pedido {{2}} foi confirmado."
Componentes opcionais: cabeçalho de texto ou de mídia, rodapé e até 10 botões. Omita o campo para um template só de texto.
Show child attributes
Show child attributes
Response
Recurso criado
Identificador do template.
"tmpl_01J8ZK9M3Q7XABCDEFGHJKMNPQ"
Canal ao qual o template pertence.
"chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ"
Nome do template.
"confirmacao_pedido"
Código de idioma.
"pt_BR"
Categoria: marketing, utility ou authentication.
marketing, utility, authentication Placeholders posicionais do corpo ({{1}}, {{2}}, …).
Show child attributes
Show child attributes
Estado de aprovação. Somente approved permite enviar.
draft, submitted, pending, approved, rejected, paused, disabled Motivo da rejeição, quando status é rejected.
abusive_content, incorrect_category, invalid_format, scam, tag_content_mismatch, other Quando o template foi criado.
"2026-09-04T13:22:41.031Z"
Quando o template foi atualizado pela última vez.
"2026-09-04T13:22:41.031Z"
Cabeçalho, rodapé e botões do template, quando existirem.
Show child attributes
Show child attributes