Skip to main content
POST
/
messages
Template
curl --request POST \
  --url http://localhost:3000/api/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messaging_product": "<string>",
  "to": "<string>",
  "type": "<string>",
  "template": {
    "template.name": "<string>",
    "template.language": {
      "template.language.code": "<string>"
    },
    "template.components": [
      {}
    ]
  }
}
'
{
  "messaging_product": "whatsapp",
  "contacts": [{ "input": "5511999999999", "wa_id": "5511999999999" }],
  "messages": [{ "id": "wamid.HBgLNTUxMTk5OTk5OTk5..." }]
}
Templates precisam estar com status APPROVED antes de serem usados. Crie em Templates → Criar.
messaging_product
string
default:"whatsapp"
required
to
string
required
Número do destinatário no formato E.164 sem o +.
type
string
default:"template"
required
template
object
required

Exemplos

{
  "messaging_product": "whatsapp",
  "to": "5511999999999",
  "type": "template",
  "template": {
    "name": "order_confirmation",
    "language": { "code": "pt_BR" },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "João" },
          { "type": "text", "text": "#12345" }
        ]
      }
    ]
  }
}
{
  "messaging_product": "whatsapp",
  "contacts": [{ "input": "5511999999999", "wa_id": "5511999999999" }],
  "messages": [{ "id": "wamid.HBgLNTUxMTk5OTk5OTk5..." }]
}