Pular para o conteúdo principal
POST
/
v1
/
sessions
/
{sessionId}
/
message
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "text", "text": {"body": "Olá, como posso ajudar?"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "image", "media": {"mimeType": "image/png", "url": "https://exemplo.com/foto.png", "caption": "Foto do produto"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "video", "media": {"mimeType": "video/mp4", "url": "https://exemplo.com/video.mp4", "caption": "Vídeo tutorial"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "audio", "media": {"mimeType": "audio/ogg", "url": "https://exemplo.com/audio.ogg", "caption": "Mensagem de voz"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "document", "media": {"mimeType": "application/pdf", "url": "https://exemplo.com/contrato.pdf", "caption": "Contrato"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "sticker", "media": {"mimeType": "image/webp", "url": "https://exemplo.com/sticker.webp"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "interactive", "interactive": {"type": "button_reply", "button_reply": {"id": "btn_support", "title": "Suporte"}}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "interactive", "interactive": {"type": "list_reply", "list_reply": {"id": "row_pricing", "title": "Planos e Preços"}}}'
{
  "messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued"
}
Envie uma mensagem para uma sessão ativa. O motor de fluxos processa a mensagem, avança para o próximo nó e entrega a resposta para a URL de callback.
X-Api-Key
string
obrigatório
Sua chave de API (prefixada com wh_).
sessionId
string
obrigatório
O UUID da sessão ativa.

Body

type
string
obrigatório
Tipo da mensagem: text, interactive, image, video, audio, document ou sticker.
text
object
Payload de texto. Envie quando type for text.
media
object
Payload de mídia. Envie quando type for image, video, audio, document ou sticker.
interactive
object
Payload interativo. Envie quando type for interactive.

Exemplos de payload

{
  "type": "text",
  "text": {
    "body": "Olá, como posso ajudar?"
  }
}
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "text", "text": {"body": "Olá, como posso ajudar?"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "image", "media": {"mimeType": "image/png", "url": "https://exemplo.com/foto.png", "caption": "Foto do produto"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "video", "media": {"mimeType": "video/mp4", "url": "https://exemplo.com/video.mp4", "caption": "Vídeo tutorial"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "audio", "media": {"mimeType": "audio/ogg", "url": "https://exemplo.com/audio.ogg", "caption": "Mensagem de voz"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "document", "media": {"mimeType": "application/pdf", "url": "https://exemplo.com/contrato.pdf", "caption": "Contrato"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "sticker", "media": {"mimeType": "image/webp", "url": "https://exemplo.com/sticker.webp"}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "interactive", "interactive": {"type": "button_reply", "button_reply": {"id": "btn_support", "title": "Suporte"}}}'
curl -X POST https://api.whatabot.app/api/v1/sessions/{sessionId}/message \
  -H "X-Api-Key: wh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"type": "interactive", "interactive": {"type": "list_reply", "list_reply": {"id": "row_pricing", "title": "Planos e Preços"}}}'
{
  "messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued"
}