Skip to main content
POST
/
templates
Criar Template
curl --request POST \
  --url http://localhost:3000/api/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "language": "<string>",
  "category": "<string>",
  "components": [
    {}
  ]
}
'
Requer token de instância. Templates criados ficam com status PENDING até aprovação da Meta (geralmente algumas horas).
waba-id
string
required
ID do WhatsApp Business Account.
name
string
required
Nome do template (snake_case, sem espaços).
language
string
required
Código do idioma. Ex: pt_BR, en_US.
category
string
required
MARKETING, UTILITY ou AUTHENTICATION.
components
array
required
Array de componentes do template.

Exemplos

{
  "name": "order_confirmation",
  "language": "pt_BR",
  "category": "UTILITY",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Pedido Confirmado ✅"
    },
    {
      "type": "BODY",
      "text": "Olá {{1}}, seu pedido *#{{2}}* foi confirmado e será entregue em {{3}} dias úteis."
    },
    {
      "type": "FOOTER",
      "text": "Obrigado pela compra!"
    }
  ]
}

Resposta

{
  "id": "1234567890",
  "status": "PENDING",
  "category": "UTILITY"
}