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

# Send Message

> Send a message into an active session.

Send a message into an active session. The flow engine processes the message, advances to the next node, and delivers the response to the callback URL.

<ParamField header="X-Api-Key" type="string" required>
  Your API key (prefixed with `wh_`).
</ParamField>

<ParamField path="sessionId" type="string" required>
  The UUID of the active session.
</ParamField>

### Body

<ParamField body="type" type="string" required>
  Message type: `text`, `interactive`, `image`, `video`, `audio`, `document`, or `sticker`.
</ParamField>

<ParamField body="text" type="object">
  Text payload. Send when `type` is `text`.

  <Expandable title="Fields">
    <ParamField body="text.body" type="string" required>
      The text content of the message.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="media" type="object">
  Media payload. Send when `type` is `image`, `video`, `audio`, `document`, or `sticker`.

  <Expandable title="Fields">
    <ParamField body="media.mimeType" type="string" required>
      File MIME type (e.g., `image/png`, `video/mp4`).
    </ParamField>

    <ParamField body="media.url" type="string" required>
      Public URL of the file.
    </ParamField>

    <ParamField body="media.caption" type="string">
      Media caption.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="interactive" type="object">
  Interactive payload. Send when `type` is `interactive`.

  <Expandable title="Fields">
    <ParamField body="interactive.type" type="string" required>
      Interaction type: `button_reply` or `list_reply`.
    </ParamField>

    <ParamField body="interactive.button_reply" type="object">
      Button reply.

      <Expandable title="Fields">
        <ParamField body="interactive.button_reply.id" type="string" required>
          The button ID.
        </ParamField>

        <ParamField body="interactive.button_reply.title" type="string" required>
          The button label.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="interactive.list_reply" type="object">
      List reply.

      <Expandable title="Fields">
        <ParamField body="interactive.list_reply.id" type="string" required>
          The selected row ID.
        </ParamField>

        <ParamField body="interactive.list_reply.title" type="string" required>
          The selected row title.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

### Payload examples

<Tabs>
  <Tab title="Text">
    ```json theme={null}
    {
      "type": "text",
      "text": {
        "body": "Hello, how can I help?"
      }
    }
    ```
  </Tab>

  <Tab title="Image">
    ```json theme={null}
    {
      "type": "image",
      "media": {
        "mimeType": "image/png",
        "url": "https://example.com/photo.png",
        "caption": "Product photo"
      }
    }
    ```
  </Tab>

  <Tab title="Video">
    ```json theme={null}
    {
      "type": "video",
      "media": {
        "mimeType": "video/mp4",
        "url": "https://example.com/video.mp4",
        "caption": "Tutorial video"
      }
    }
    ```
  </Tab>

  <Tab title="Audio">
    ```json theme={null}
    {
      "type": "audio",
      "media": {
        "mimeType": "audio/ogg",
        "url": "https://example.com/audio.ogg",
        "caption": "Voice message"
      }
    }
    ```
  </Tab>

  <Tab title="Document">
    ```json theme={null}
    {
      "type": "document",
      "media": {
        "mimeType": "application/pdf",
        "url": "https://example.com/contract.pdf",
        "caption": "Contract"
      }
    }
    ```
  </Tab>

  <Tab title="Sticker">
    ```json theme={null}
    {
      "type": "sticker",
      "media": {
        "mimeType": "image/webp",
        "url": "https://example.com/sticker.webp"
      }
    }
    ```
  </Tab>

  <Tab title="Button">
    ```json theme={null}
    {
      "type": "interactive",
      "interactive": {
        "type": "button_reply",
        "button_reply": {
          "id": "btn_support",
          "title": "Support"
        }
      }
    }
    ```
  </Tab>

  <Tab title="List">
    ```json theme={null}
    {
      "type": "interactive",
      "interactive": {
        "type": "list_reply",
        "list_reply": {
          "id": "row_pricing",
          "title": "Plans & Pricing"
        }
      }
    }
    ```
  </Tab>
</Tabs>

<RequestExample>
  ```bash Text theme={null}
  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": "Hello, how can I help?"}}'
  ```

  ```bash Image theme={null}
  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://example.com/photo.png", "caption": "Product photo"}}'
  ```

  ```bash Video theme={null}
  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://example.com/video.mp4", "caption": "Tutorial video"}}'
  ```

  ```bash Audio theme={null}
  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://example.com/audio.ogg", "caption": "Voice message"}}'
  ```

  ```bash Document theme={null}
  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://example.com/contract.pdf", "caption": "Contract"}}'
  ```

  ```bash Sticker theme={null}
  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://example.com/sticker.webp"}}'
  ```

  ```bash Button Reply theme={null}
  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": "Support"}}}'
  ```

  ```bash List Reply theme={null}
  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": "Plans & Pricing"}}}'
  ```
</RequestExample>

<ResponseExample>
  ```json 202 theme={null}
  {
    "messageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "queued"
  }
  ```
</ResponseExample>
