API de Mensagens
Envie mensagens WhatsApp via API. Todos os endpoints usam o ID da instância como parâmetro de rota.
POST https://grwthy.com/v1/messages/:type/:id
Campos Comuns
Todos os tipos de mensagem (exceto reação) aceitam estes campos opcionais:
Responder a uma mensagem específica.ID da mensagem a ser respondida.
URL customizada para receber o status desta mensagem.
Enviar Texto
POST https://grwthy.com/v1/messages/text/:id
Número do destinatário com código do país, sem +. Ex: 5511999999999
Habilitar pré-visualização de links. Padrão: false.
Exemplo
curl -X POST https://grwthy.com/v1/messages/text/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"text": "Olá do Grwthy!"
}'
Enviar Mídia
POST https://grwthy.com/v1/messages/media/:id
Tipo de mídia: image, video ou document.
URL pública da mídia ou conteúdo em base64.
MIME type do arquivo (ex: image/jpeg, application/pdf).
Nome do arquivo (usado para documentos).
Exemplo — Imagem
curl -X POST https://grwthy.com/v1/messages/media/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"mediatype": "image",
"media": "https://exemplo.com/foto.jpg",
"caption": "Confira nossa promoção!"
}'
Exemplo — Documento
curl -X POST https://grwthy.com/v1/messages/media/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"mediatype": "document",
"media": "https://exemplo.com/relatorio.pdf",
"fileName": "relatorio-mensal.pdf"
}'
Enviar Áudio
POST https://grwthy.com/v1/messages/audio/:id
URL pública do áudio ou conteúdo em base64.
MIME type do áudio. Formatos aceitos pela Meta: audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg, audio/opus.
Exemplo
curl -X POST https://grwthy.com/v1/messages/audio/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"audio": "https://exemplo.com/audio.ogg",
"mimetype": "audio/ogg"
}'
Enviar Template
POST https://grwthy.com/v1/messages/template/:id
Templates devem ser pré-aprovados no seu WhatsApp Business Account.
Nome do template aprovado.
Código do idioma (ex: pt_BR, en_US).
Exemplo
curl -X POST https://grwthy.com/v1/messages/template/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"name": "confirmacao_pedido",
"language": "pt_BR",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "João" },
{ "type": "text", "text": "#12345" }
]
}
]
}'
Enviar Localização
POST https://grwthy.com/v1/messages/location/:id
Exemplo
curl -X POST https://grwthy.com/v1/messages/location/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"latitude": -23.5505,
"longitude": -46.6333,
"name": "São Paulo",
"address": "Av. Paulista, 1000"
}'
Enviar Contato
POST https://grwthy.com/v1/messages/contact/:id
Lista de contatos a enviar.Nome completo do contato.
Exemplo
curl -X POST https://grwthy.com/v1/messages/contact/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"contact": [
{
"fullName": "João Silva",
"phoneNumber": "5511888888888",
"organization": "Grwthy"
}
]
}'
Enviar Botões
POST https://grwthy.com/v1/messages/buttons/:id
Lista de botões (máximo 3).ID do botão (retornado quando o usuário clica).
Exemplo
curl -X POST https://grwthy.com/v1/messages/buttons/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"title": "Como podemos ajudar?",
"buttons": [
{ "reply": { "id": "btn_vendas", "title": "Vendas" } },
{ "reply": { "id": "btn_suporte", "title": "Suporte" } },
{ "reply": { "id": "btn_horario", "title": "Horários" } }
]
}'
Enviar Lista
POST https://grwthy.com/v1/messages/list/:id
Texto do botão que abre a lista.
Seções da lista.Itens da seção.sections[].rows[].description
Descrição do item.
Exemplo
curl -X POST https://grwthy.com/v1/messages/list/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"title": "Nossos serviços",
"buttonText": "Ver opções",
"sections": [
{
"title": "Planos",
"rows": [
{ "id": "starter", "title": "Starter", "description": "Para pequenos negócios" },
{ "id": "pro", "title": "Pro", "description": "Para empresas em crescimento" }
]
}
]
}'
Enviar Reação
POST https://grwthy.com/v1/messages/reaction/:id
ID da mensagem (wamid) para reagir.
Emoji da reação. Envie string vazia "" para remover a reação.
Exemplo
curl -X POST https://grwthy.com/v1/messages/reaction/clux1a2b3c4d5e6f7g8h9i0j \
-H "Content-Type: application/json" \
-H "X-Api-Key: SUA_API_KEY" \
-d '{
"number": "5511999999999",
"messageId": "wamid.HBgNNTUxMTk5OTk5OTk5FQIAEhgUM0EB",
"reaction": "👍"
}'