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
| Campo | Tipo | Descrição | |
|---|---|---|---|
number | string | obrigatório | destino |
contentText | string | obrigatório | corpo entre header e botões |
headerText | string | título | |
footerText | string | rodapé | |
buttons | array | obrigató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
| HTTP | Mensagem |
|---|---|
| 400 | number and message required / payload inválido |
| 401 | missing token / invalid token |
| 403 | token does not match instance |
| 404 | instance not found |
| 429 | rate limit exceeded (padrão 100/min) |
| 502 | Falha no WhatsApp / instância desconectada |
| 400 | contentText obrigatório / botão sem displayText |