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. SetplatformPostIdto a story media id to scope to one story, or omit it to match replies to any story.
Targeting (comment trigger):
- Per-post: set
platformPostIdto scope to one specific post (only one active per-post automation is allowed per post). - Account-wide ("any post"): omit
platformPostId(andpostId). 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 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.
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
{ "success": true, "automation": { "id": "string", "name": "string", "platform": "string", "trigger": "comment", "platformPostId": "string", "keywords": [ "string" ], "matchMode": "exact", "excludeKeywords": [ "string" ], "typoTolerance": true, "dmMessage": "string", "buttons": [ { "type": "url", "title": "string", "url": "http://example.com", "payload": "string", "phone": "string" } ], "template": { "type": "generic", "imageAspectRatio": "horizontal", "elements": [ { "title": "string", "subtitle": "string", "imageUrl": "http://example.com", "buttons": [ { "type": "url", "title": "string", "url": "http://example.com", "payload": "string" } ] } ] }, "commentReply": "string", "dmMessageVariations": [ "string" ], "commentReplyVariations": [ "string" ], "linkTracking": true, "clickTag": "string", "dmDelaySeconds": 0, "commentReplyDelaySeconds": 0, "audience": { "followerStatus": "any", "minFollowerCount": 0, "whenUnknown": "send" }, "followGate": { "message": "string", "buttonLabel": "string", "notFollowingMessage": "string" }, "alsoMatchInDms": true, "isActive": true, "stats": { "totalTriggered": 0, "totalSent": 0, "totalFailed": 0 }, "createdAt": "2019-08-24T14:15:22Z" }}