> ## 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 Messenger message

> Sends a Messenger text message from a Facebook Page.

`metaAds.sendMessengerMessage` sends a Messenger text message from a Facebook Page to one person.

```ts automations/meta-ads-send-messenger-message.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { metaAds } from "automate.ax/meta-ads"

export default automation("Send Messenger message", () => {
  onDashboardRun({ title: "Send Messenger message" })
  metaAds.sendMessengerMessage({
    pageId: "page-id",
    recipientId: "page-scoped-id",
    text: "Your order is ready for pickup.",
  })
})
```

Pass the person's PSID as `recipientId`; it's `senderId` in [On Messenger message received](https://docs.automate.ax/reference/integrations/meta-ads/triggers/on-messenger-message-received.md). `text` accepts up to 2,000 characters. `messagingType` defaults to `RESPONSE`; use `UPDATE` for a proactive update. Optional second argument `{ account }` selects a static project account binding.

Meta accepts both types only inside the standard messaging window: 24 hours after the person's last message, comment, or other interaction, or up to 7 days after a Click-to-Messenger ad conversation starts. Message tags aren't supported. Meta returns error `551` when the person isn't available.

Returns `recipientId` and `messageId`. Sends aren't replay-safe. The action needs `pages_messaging` and `pages_show_list`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.