Mensagens

Enviar botões

Até 3 botões interativos: REPLY, URL, CALL ou COPY. Header de texto (headerText).

Tipos de botão

REPLY (padrão) — o cliente toca e o WhatsApp envia o displayText citando a mensagem. No webhook chega o `id`.

URL — abre o link. Coloque a URL em `id` (https://…).

CALL — disca o número. Coloque o telefone em `id` (+5511…).

COPY — copia o código em `id` (cupom, chave, protocolo).

Não misture REPLY com URL/CALL/COPY. Se misturar, o Wagzap envia só os CTA e coloca os REPLY no texto — senão o WhatsApp descarta o bubble inteiro.

Limites

WhatsApp aceita no máximo 3 botões. Quatro ou mais falham no cliente.

Aparelhos antigos podem cair em fallback de texto.

POST/api/message/button/{instance}

Enviar botões

Mensagem interativa com 1 a 3 botões.

Auth: TokenInstance

Body

CampoTipoDescrição
numberstringobrigatóriodestino
contentTextstringobrigatóriocorpo entre header e botões
headerTextstringtítulo
footerTextstringrodapé
buttonsarrayobrigatório[{ displayText, id, type }] — type: REPLY | URL | CALL | COPY

cURL

curl -X POST https://api.wagzap.com.br/api/message/button/vendas \
  -H "token: $TOKEN_INSTANCE" \
  -H "Content-Type: application/json" \
  -d '{
  "number": "5511999999999",
  "headerText": "Atendimento",
  "contentText": "Como podemos ajudar?",
  "footerText": "Wagzap",
  "buttons": [
    {
      "displayText": "Comercial",
      "id": "sales",
      "type": "REPLY"
    },
    {
      "displayText": "Suporte",
      "id": "support",
      "type": "REPLY"
    }
  ]
}'

JavaScript

await fetch(`https://api.wagzap.com.br/api/message/button/${instance}`, {
  method: "POST",
  headers: { token: process.env.TOKEN_INSTANCE, "Content-Type": "application/json" },
  body: JSON.stringify({
    "number": "5511999999999",
    "headerText": "Atendimento",
    "contentText": "Como podemos ajudar?",
    "footerText": "Wagzap",
    "buttons": [
      {
        "displayText": "Comercial",
        "id": "sales",
        "type": "REPLY"
      },
      {
        "displayText": "Suporte",
        "id": "support",
        "type": "REPLY"
      }
    ]
  })
});

Resposta

{
  "success": true,
  "messageId": "3EB08FCF27E532F1F5F5",
  "data": { "messageId": "3EB08FCF27E532F1F5F5" }
}
  • Clique em REPLY chega no webhook (message.exchange) com o id do botão.
  • Teste no playground do tenant: escolha instância, número e configure cada botão.

Erros

HTTPMensagem
400number and message required / payload inválido
401missing token / invalid token
403token does not match instance
404instance not found
429rate limit exceeded (padrão 100/min)
502Falha no WhatsApp / instância desconectada
400contentText obrigatório / botão sem displayText