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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Send message

> Send freeform text inside an open WhatsApp customer-service window.

`sendWhatsAppMessage` sends text to an opted-in individual recipient through the connected WhatsApp Business Platform phone number.

```ts automations/reply-on-whatsapp.automation.ts theme={null}
import { automation } from "automate.ax"
import {
  onWhatsAppMessageReceived,
  sendWhatsAppMessage,
} from "automate.ax/whatsapp"

export default automation("Reply on WhatsApp", () => {
  const received = onWhatsAppMessageReceived()

  sendWhatsAppMessage({
    to: received.sender.id,
    body: "Thanks — we received your message.",
    replyToMessageId: received.message.id,
  })
})
```

`to` and a non-empty `body` of at most 4,096 characters are required. Optional inputs are `previewUrl`, `replyToMessageId`, `callbackData`, and static `account`.

Returns `{ messageId, recipientId, status? }`. The optional immediate status is `accepted`, `held_for_quality_assessment`, or `paused`; use `onWhatsAppMessageStatusChanged` for delivery outcomes.

Freeform messages are allowed only within 24 hours of the recipient's latest message. Use an approved template outside that window. The customer must have opted in before any business-initiated message.

This action targets individual recipients. WhatsApp group membership and group messaging are not supported by this integration.
