Create a keyword automation
create_keywordCreate Instagram comment-to-DM automations that send a direct message when people comment a chosen keyword, with optional public replies and targeting for next, all, or specific posts.
Instructions
Create a comment-to-DM automation: when someone comments the keyword, CommentKeyword sends them the DM (and optionally replies publicly). Confirm the details with the user first, because it messages real people. Fails with 409 if the keyword already exists for the same posts, or with keyword_limit_exceeded when the plan has no free active-keyword slot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Which posts trigger the DM. next_post: the next post or reel published on the connected Instagram account (best for a video that is not live yet). all_posts: every post, current and future. specific_posts: only the Instagram media IDs in mediaIds. | |
| keyword | Yes | The word people comment, e.g. "GUIDE". Matching is case-insensitive. Prefer one distinctive word. | |
| isActive | No | Create it active (default) or paused. Only active keywords count toward the plan limit. | |
| mediaIds | No | Instagram media IDs. Required for target "specific_posts"; with "next_post" they are matched too. | |
| aiAgentId | No | Optional publicId of an existing Live AI agent (from list_agents) that takes over the conversation when the person replies to the DM. Its conversation hook is appended to the DM. Only works on paid plans; on Free the agent is ignored. null detaches it. | |
| matchMode | No | contains (default): the comment only has to include the keyword as a word, e.g. "GUIDE please!". exact: the whole comment must be the keyword. | |
| dmMessages | Yes | DM variants (1-10); one is picked at random per commenter, so 2-3 wordings of the same message feel less robotic. Each must deliver the promised link. Max 1,000 characters each. Supports {{handle}}, {{name}}, {{namefirst}}. | |
| trackLinks | No | Replace links in the DM with tracked links to count clicks. | |
| commentReplies | No | Optional public reply variants (up to 10), one picked at random per comment, e.g. "Sent! Check your DMs {{namefirst}}". Max 500 characters each. | |
| publicReplyEnabled | No | Post one of commentReplies publicly. Defaults to true when commentReplies is not empty. | |
| matchWithoutAccents | No | Only for keywords with Latin accents: also match the unaccented spelling (e.g. "guía" also matches "guia"). |