Skip to content

Create comment-to-DM automation

Create a keyword-triggered DM automation on an Instagram or Facebook account. When someone comments a matching keyword, they automatically receive a DM.

Two modes:

  • Per-post — set platformPostId to scope the automation 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.

POST /v1/comment-automations

Create a keyword-triggered DM automation on an Instagram or Facebook account. When someone comments a matching keyword, they automatically receive a DM.

Two modes:

  • Per-post — set platformPostId to scope the automation 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.

Request body

Content-Type: application/json

  • profileId (string) required
  • accountId (string) required — Instagram or Facebook account ID
  • platformPostId (string) — Platform media/post ID. Omit for an account-wide (any-post) automation.
  • postId (string) — Zernio post ID. Required only when also targeting a specific post via platformPostId.
  • postTitle (string) — Post content snippet for display
  • name (string) required — Automation label
  • keywords (array) — Trigger keywords (empty = any comment triggers)
  • matchMode (string) (enum: exact, contains)
  • dmMessage (string) required — DM text to send to commenter. Max 640 chars when buttons are set, otherwise ~1000.
  • buttons (array) — Optional inline DM buttons (1-3). Phone buttons are Facebook-only. Omit or pass [] for a plain-text DM.
  • commentReply (string) — Optional public reply to the comment

Responses

200 — Automation created

  • success (boolean)
  • automation (object)

400 — Validation error

401

409 — Active per-post automation already exists for this platformPostId. Does not apply to account-wide automations.