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

> Sends an Instagram direct message from a professional account.

`metaAds.sendInstagramMessage` sends an Instagram direct text message from a professional account to one person.

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

export default automation("Send Instagram message", () => {
  onDashboardRun({ title: "Send Instagram message" })
  metaAds.sendInstagramMessage({
    instagramAccountId: "instagram-account-id",
    recipientId: "instagram-scoped-id",
    text: "Your order is ready for pickup.",
  })
})
```

Find `instagramAccountId` with [List Instagram accounts](https://docs.automate.ax/reference/integrations/meta-ads/actions/list-instagram-accounts.md). Pass the person's IGSID as `recipientId`; it's `senderId` in [On Instagram message received](https://docs.automate.ax/reference/integrations/meta-ads/triggers/on-instagram-message-received.md). Automate.ax sends through the Facebook Page linked to the Instagram account. `text` must be under 1,000 bytes. Meta accepts messages only inside the standard messaging window: 24 hours after the person's last message or interaction, or up to 7 days after a Click-to-Instagram-Direct ad conversation starts. Optional second argument `{ account }` selects a static project account binding.

Returns `recipientId` and `messageId`. Sends aren't replay-safe. The action needs `instagram_basic`, `instagram_manage_messages`, `pages_read_engagement`, and `pages_show_list`.


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