> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectalk.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Visão Geral

> Todos os tipos de mensagem suportados pelo Vectax Hub

## Tipos de mensagem

<Tabs>
  <Tab title="Texto">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "text",
      "text": {
        "preview_url": false,
        "body": "Olá! Como posso ajudar?"
      }
    }
    ```
  </Tab>

  <Tab title="Imagem">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "image",
      "image": {
        "link": "https://example.com/image.jpg",
        "caption": "Confira nosso produto!"
      }
    }
    ```

    <Info>Use `id` em vez de `link` para mídias já enviadas via [Upload de Mídia](/api-reference/media/upload).</Info>
  </Tab>

  <Tab title="Documento">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "document",
      "document": {
        "link": "https://example.com/relatorio.pdf",
        "filename": "relatorio.pdf",
        "caption": "Relatório mensal"
      }
    }
    ```
  </Tab>

  <Tab title="Áudio">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "audio",
      "audio": {
        "link": "https://example.com/audio.ogg"
      }
    }
    ```
  </Tab>

  <Tab title="Vídeo">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "video",
      "video": {
        "link": "https://example.com/video.mp4",
        "caption": "Assista ao tutorial!"
      }
    }
    ```
  </Tab>

  <Tab title="Localização">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "location",
      "location": {
        "longitude": -46.6333,
        "latitude": -23.5505,
        "name": "Av. Paulista",
        "address": "Av. Paulista, 1000 - São Paulo, SP"
      }
    }
    ```
  </Tab>

  <Tab title="Template">
    ```json theme={null}
    {
      "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" }
            ]
          }
        ]
      }
    }
    ```
  </Tab>

  <Tab title="Botões">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "interactive",
      "interactive": {
        "type": "button",
        "header": {
          "type": "text",
          "text": "Confirmação de pedido"
        },
        "body": {
          "text": "Deseja confirmar seu pedido?"
        },
        "footer": {
          "text": "Responda abaixo"
        },
        "action": {
          "buttons": [
            { "type": "reply", "reply": { "id": "confirm_yes", "title": "Sim, confirmar" } },
            { "type": "reply", "reply": { "id": "confirm_no", "title": "Cancelar" } }
          ]
        }
      }
    }
    ```

    <Note>Máximo de 3 botões por mensagem.</Note>
  </Tab>

  <Tab title="Lista">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "interactive",
      "interactive": {
        "type": "list",
        "body": { "text": "Selecione um produto:" },
        "footer": { "text": "Estoque disponível" },
        "action": {
          "button": "Ver produtos",
          "sections": [
            {
              "title": "Eletrônicos",
              "rows": [
                { "id": "prod_001", "title": "Smartphone X", "description": "R$ 1.999,00" },
                { "id": "prod_002", "title": "Fone Bluetooth", "description": "R$ 299,00" }
              ]
            }
          ]
        }
      }
    }
    ```
  </Tab>

  <Tab title="CTA / Link">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "interactive",
      "interactive": {
        "type": "cta_url",
        "body": { "text": "Acesse nosso portal para mais informações" },
        "action": {
          "name": "cta_url",
          "parameters": {
            "display_text": "Acessar Portal",
            "url": "https://vectax.com"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Flow">
    ```json theme={null}
    {
      "recipient_type": "individual",
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "interactive",
      "interactive": {
        "type": "flow",
        "header": {
          "type": "text",
          "text": "Pesquisa de satisfação"
        },
        "body": { "text": "Preencha nossa pesquisa de satisfação:" },
        "footer": { "text": "Leva menos de 1 minuto" },
        "action": {
          "name": "flow",
          "parameters": {
            "flow_message_version": "3",
            "flow_token": "unused",
            "flow_id": "FLOW_ID",
            "flow_cta": "Responder pesquisa",
            "flow_action": "navigate",
            "flow_action_payload": {
              "screen": "INTRO",
              "data": { "user_name": "João" }
            }
          }
        }
      }
    }
    ```

    <Note>
      `flow_message_version` deve ser `"3"`. `flow_token` é opcional (default `"unused"`).
      `flow_action` pode ser `"navigate"` (default) ou `"data_exchange"`.
      Quando `flow_action` é `"navigate"`, o campo `flow_action_payload.screen` é obrigatório.
    </Note>
  </Tab>

  <Tab title="Produto">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "interactive",
      "interactive": {
        "type": "product",
        "body": { "text": "Confira este produto:" },
        "action": {
          "catalog_id": "CATALOG_ID",
          "product_retailer_id": "SKU_001"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Reação">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "to": "5511999999999",
      "type": "reaction",
      "reaction": {
        "message_id": "wamid.HBgLNTUxMTk5OTk5OTk5...",
        "emoji": "👍"
      }
    }
    ```
  </Tab>

  <Tab title="Grupo">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "recipient_type": "group",
      "to": "GROUP_ID",
      "type": "text",
      "text": {
        "body": "Olá grupo!"
      }
    }
    ```

    <Warning>
      Para enviar mensagens a grupos, o campo `recipient_type` deve ser `"group"` e `to` deve conter o ID do grupo.
      Todos os tipos de mensagem (texto, imagem, template, etc.) funcionam — basta adicionar `"recipient_type": "group"`.
    </Warning>
  </Tab>

  <Tab title="Marcar como lida">
    ```json theme={null}
    {
      "messaging_product": "whatsapp",
      "status": "read",
      "message_id": "wamid.HBgLNTUxMTk5OTk5OTk5..."
    }
    ```
  </Tab>
</Tabs>

## Parâmetros

<ParamField body="messaging_product" type="string" required default="whatsapp">
  Sempre `"whatsapp"`.
</ParamField>

<ParamField body="recipient_type" type="string" default="individual">
  `"individual"` para mensagens diretas (default) ou `"group"` para mensagens em grupo. **Obrigatório** quando `to` é um ID de grupo.
</ParamField>

<ParamField body="to" type="string" required placeholder="5511999999999">
  Número do destinatário no formato E.164 sem o `+`, ou ID do grupo quando `recipient_type` é `"group"`.
</ParamField>

<ParamField body="type" type="string" required default="text">
  Tipo da mensagem: `text`, `image`, `document`, `audio`, `video`, `sticker`, `location`, `contacts`, `template`, `interactive`, `reaction`.
</ParamField>

<ParamField body="text" type="object">
  Obrigatório quando `type` é `text`.

  <Expandable title="campos">
    <ParamField body="text.body" type="string" required placeholder="Olá! Como posso ajudar?">
      Conteúdo da mensagem (máx. 4096 caracteres).
    </ParamField>

    <ParamField body="text.preview_url" type="boolean" default={false}>
      Exibir preview de links.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="image" type="object">
  Obrigatório quando `type` é `image`. Use `link` (URL pública) ou `id` (media\_id do upload).
</ParamField>

<ParamField body="document" type="object">
  Obrigatório quando `type` é `document`. Use `link` ou `id` + `filename`.
</ParamField>

<ParamField body="audio" type="object">
  Obrigatório quando `type` é `audio`. Use `link` ou `id`.
</ParamField>

<ParamField body="video" type="object">
  Obrigatório quando `type` é `video`. Use `link` ou `id`.
</ParamField>

<ParamField body="template" type="object">
  Obrigatório quando `type` é `template`. Veja exemplos nas abas acima.
</ParamField>

<ParamField body="interactive" type="object">
  Obrigatório quando `type` é `interactive`. Suporta `button`, `list`, `cta_url`, `flow`, `product`, `product_list`.
</ParamField>

<ParamField body="reaction" type="object">
  Obrigatório quando `type` é `reaction`. Campos: `message_id`, `emoji`.
</ParamField>

<ParamField body="phone_number_id" type="string">
  Obrigatório apenas com **token de organização**. Com token de instância é resolvido automaticamente.
</ParamField>

## Resposta

```json theme={null}
{
  "messaging_product": "whatsapp",
  "contacts": [
    { "input": "5511999999999", "wa_id": "5511999999999" }
  ],
  "messages": [
    { "id": "wamid.HBgLNTUxMTk5OTk5OTk5..." }
  ]
}
```
