Create comment-to-DM automation
Changed onCreate a keyword-triggered automation. On Instagram and Facebook, when someone comments a matching keyword (or, with trigger: story_reply, replies to your Instagram story with one), they automatically receive a DM.
Platforms:
- instagram, facebook: the full DM automation (private reply, buttons, product card, audience rules, follow gate) plus the optional public reply.
- tiktok, threads, linkedin, youtube: public reply only. These platforms have no private reply to a comment, so the automation answers a matching comment with commentReply and nothing else. commentReply is required and the DM fields (dmMessage, dmMessageVariations, buttons, template, quickReplies, alsoMatchInDms, audience, followGate, dmDelaySeconds, commentReplyDelaySeconds) are rejected with a 400 naming the field. TikTok comments arrive by webhook (TikTok business accounts only); the others are read by the comment poll, so a reply follows the comment by up to the poll interval (10 minutes on posts from the last 24 hours, longer on older posts). repeatPolicy applies there too: with the default once, a person gets one public reply per automation, and their later comments get none.
- X accounts are refused with a 400 (platform_not_supported): X comment polling is off, so an X automation could never fire.
To continue into a specific workflow after the recipient taps a button, use {"type":"postback","title":"Send it","payload":"zernio:workflow:<workflowId>"}. The target must be active and belong to the same account and profile. This also works for product-card buttons. The tap starts that workflow directly, without matching its keyword or first-message condition. A tap on a workflow that is waiting on wait_for_reply in that conversation answers that wait and resumes the run. A tap on a different active workflow starts it and exits the other live runs. Stale or invalid targets still do nothing. The initial comment DM alone does not start the workflow: the recipient must tap.
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.
- live_comment (Instagram only): fires on keyword comments made during one of your Instagram live broadcasts and answers them with a private reply. comment automations never fire on live comments, and live_comment ones never fire on post comments. Meta only accepts the private reply while the broadcast is live.
- story_mention (Instagram only): fires when someone mentions your account in their story, and answers them with a DM. A mention carries no text and Meta does not identify the story, so keywords must be empty and platformPostId omitted.
Comments on Instagram and Facebook arrive by webhook. Every 10 minutes Zernio also reads the latest comments and replies back (the bound post, or the 5 newest posts for an account-wide automation, up to 20 Graph reads per account per run; a post not fully read is picked up again on the next run) and runs any comment the webhook did not deliver, so a dropped webhook still fires. A comment is answered at most once whichever path sees it first.
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. Set audience.tapToUnlock: true instead to send that button DM to every commenter and deliver the real DM on the tap with no follow check.
Set alsoMatchInDms: true on a comment automation to also answer people who send a keyword as a direct message instead of commenting it. One automation then covers both doors, and each door is deduplicated separately (someone who already got the DM from their comment still gets it if they later DM the keyword). Requires at least one keyword.
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.
Personalisation: {{first_name}}, {{name}} and {{username}} in dmMessage, commentReply, their variations and button titles resolve from the commenter. {{first_name}} is the first word of the display name and {{name}} the display name; when the platform gives no display name both fall back to the platform username (unless it is all digits). {{username}} is the platform username. A value still unknown resolves to an empty string and the space before it is dropped.
Behaviour: repeatPolicy decides whether a person can get the DM again, dedupeSameTextHours stops two automations sending the same text to one person, publicReplyPolicy decides whether the public reply waits for the DM, and actions likes or hides the matched comment.
Request
- Base URL: https://zernio.com/api
- URL: https://zernio.com/api/v1/comment-automations
- Auth: HTTP bearer
Request body
Response
Automation created
Changes
- warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
added the new
facebookenum value to the/response property for the response status - warning
added the new
instagramenum value to the/response property for the response status - warning
added the new
linkedinenum value to the/response property for the response status - warning
added the new
live_commentenum value to the/response property for the response status - warning
added the new
story_mentionenum value to the/response property for the response status - warning
added the new
threadsenum value to the/response property for the response status - warning
added the new
tiktokenum value to the/response property for the response status - warning
added the new
youtubeenum value to the/response property for the response status - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
the request property
became optional - info
added the new
live_commentenum value to the request property - info
added the new
story_mentionenum value to the request property - info
added the media type
application/jsonfor the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- warning
- warning
added the new
accountenum value to the/response property for the response status - warning
added the new
accountenum value to the/response property for the response status
- warning