v2

latestOpenAPI 3.1.02026-08-075421692.0 MB
Comment Automations

Create comment-to-DM automation

Create a keyword-triggered DM automation on an Instagram or Facebook account. When someone comments a matching keyword (or, with trigger: story_reply, replies to your Instagram story with one), they automatically receive a DM.

Triggers (trigger):

  • comment (default): fires on keyword comments on a post or reel.
  • story_reply: fires when someone replies to your Instagram story with a keyword, and answers them with a DM. Set platformPostId to a story media id to scope to one story, or omit it to match replies to any story.

Targeting (comment trigger):

  • Per-post: set platformPostId to scope to one specific post (only one active per-post automation is allowed per post).
  • Account-wide ("any post"): omit platformPostId (and postId). The automation evaluates every comment on every post on the account. You can stack unlimited account-wide automations, each with its own keyword set, and they all run independently. Per-post automations take priority on their post.

Audience (audience, Instagram only): restrict the automation to followers or non-followers, and/or to accounts above a follower count. Instagram only reveals the follow relationship for people who have messaged the account, so audience.whenUnknown decides what happens for everyone else - including verify, which sends a one-tap confirmation DM (followGate) and then delivers the real DM automatically. People we already know follow you skip the tap entirely.

Links in the DM's buttons can be click-tracked (linkTracking, on by default) and clickers optionally tagged (clickTag) for segmentation. Stats returned include delivered, read, and link clicks.

post/v1/comment-automations

Request body

profileIdstring required
accountIdstring required

Instagram or Facebook account ID

trigger'comment' | 'story_reply'

What fires the automation. 'comment' (keyword comment on a post) or 'story_reply' (keyword reply to an Instagram story). For 'story_reply', platformPostId is the story media id (omit for any story).

platformPostIdstring

Platform media/post ID (or story media id when trigger=story_reply). Omit for an account-wide (any-post / any-story) automation.

postIdstring

Zernio post ID. Required only when also targeting a specific post via platformPostId.

postTitlestring

Post content snippet for display

namestring required

Automation label

keywordsstring[]

Trigger keywords (empty = any comment triggers)

matchMode'exact' | 'contains' | 'word'

How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.

excludeKeywordsstring[]

Comments containing one of these never trigger the automation, even when a trigger keyword also matches. Compared using the same matchMode.

typoToleranceboolean

Only with matchMode=word: also fire on close misspellings of a keyword (one edit for 4-7 character keywords, two from 8 up). Keywords shorter than 4 characters are never fuzzy-matched.

dmMessagestring required

DM text to send to commenter. Max 640 chars when buttons are set, otherwise ~1000.

commentReplystring

Optional public reply to the comment

dmMessageVariationsstring[]

Optional alternate DM texts for random rotation. When set, each triggered comment sends one picked at random from [dmMessage, ...dmMessageVariations], so repeat commenters get slightly different DMs (helps avoid identical-message patterns). Up to 5. Buttons are attached to whichever text is picked, not varied.

commentReplyVariationsstring[]

Optional alternate public replies, rotated at random alongside commentReply (picked independently of the DM). Up to 5.

linkTrackingboolean

Wrap link buttons in the DM in a tracked redirect so clicks are counted (Link Clicks / CTR). Pass false to send links exactly as written. Defaults to on.

clickTagstring

Optional tag applied to a contact when they click a tracked link (requires linkTracking). Lets you segment clickers for broadcasts/sequences.

dmDelaySecondsinteger

Seconds to wait after the trigger before sending the DM. Omit or send 0 to reply immediately (the default). Max 86400 (24h). The trigger is still matched and deduplicated the moment the comment arrives, so a delay only moves when the response is sent.

commentReplyDelaySecondsinteger

Seconds to wait before posting the public comment reply. Omit or send 0 to post it right after the DM (the default). The reply never goes out before the DM, so a value below dmDelaySeconds is raised to it. Ignored when trigger=story_reply, which has no public reply.

Response

Automation created

successboolean