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

# On Instagram mention created

> Starts when someone mentions an Instagram account in a caption or comment.

`metaAds.onInstagramMentionCreated` starts when someone @mentions a selected Instagram professional account in a media caption or a comment.

```ts automations/meta-ads-on-instagram-mention-created.automation.ts theme={null}
import { automation, sendEmail } from "automate.ax"
import { metaAds } from "automate.ax/meta-ads"

export default automation("Email Instagram mentions", () => {
  const mention = metaAds.onInstagramMentionCreated({
    instagramAccountId: "instagram-account-id",
  })
  sendEmail({ subject: "New Instagram mention", text: mention.mediaId })
})
```

Find `instagramAccountId` with [List Instagram accounts](https://docs.automate.ax/reference/integrations/meta-ads/actions/list-instagram-accounts.md). The account must be linked to a Facebook Page the connection manages. Meta sends no notification when the media's owner is private, and story mentions arrive as Instagram messages instead. Optional `account` selects a static project account binding.

The event includes `instagramAccountId`, `mediaId`, `occurredAt` in Unix seconds, and `kind`. `kind` is `caption` for a caption mention or `comment` for a comment mention; comment mentions also include `commentId`. A mention on another account's media isn't readable with [Get Instagram comment](https://docs.automate.ax/reference/integrations/meta-ads/actions/get-instagram-comment.md); Meta exposes it through the Instagram account's `mentioned_comment` field. The trigger needs the same permissions as [On Instagram comment created](https://docs.automate.ax/reference/integrations/meta-ads/triggers/on-instagram-comment-created.md).


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