> ## 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.

# List Instagram messages

> Lists recent messages in an Instagram conversation.

`metaAds.listInstagramMessages` lists recent messages in one Instagram direct-message conversation.

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

export default automation("List Instagram messages", () => {
  onDashboardRun({ title: "List Instagram messages" })
  const messages = metaAds.listInstagramMessages({
    conversationId: "conversation-id",
    instagramAccountId: "instagram-account-id",
  })
  // Summarize the thread for the person who answers it.
})
```

Find `instagramAccountId` with [List Instagram accounts](https://docs.automate.ax/reference/integrations/meta-ads/actions/list-instagram-accounts.md). Meta returns details only for a conversation's 20 most recent messages, so the action has no cursor and `limit` defaults to and can't exceed `20`. Optional second argument `{ account }` selects a static project account binding.

Returns messages with `id`, `createdTime`, `from`, `to`, and `message` for up to the 20 most recent messages. The action needs the same permissions as [List Instagram conversations](https://docs.automate.ax/reference/integrations/meta-ads/actions/list-instagram-conversations.md).


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