Skip to content
Developers

Comment to DM

Comment to DM, auto DM and auto reply for comments. A keyword comment gets a direct message, a public reply or both; replies wait while an account is busy.

Someone comments a keyword on a post; the automation sends them a direct message, replies under their comment, or both. Where the platform has a private reply the DM is that private reply to the comment, and it opens a chat in the inbox; list_channels says which channels have one (the "Reply to a commenter privately" row). On every other channel where a comment triggers an automation, the public reply is all it takes.

Set one up

StepCallWhat happens
Pick a ready-made oneget_automation_catalog with include=templatesEach template names its goal, its trigger and its channels.
Read what it needsget_automation_templateIts inputs, required first. Ask the person only for what is missing.
Pick the postlist_posts with filter=source:eq:external and connectionIdLeave it out to answer comments on every post of the account.
Install itinstall_automation_templateCreated switched off; it reaches no one yet.
Check itvalidate_automationWhat it does, who it reaches, and anything that blocksPublish.
Turn it onactivate_automationOnly on the person's word.

To build your own, read the trigger and the two reply steps with list_automation_blocks (filter=key:in:<keys>&include=input,definition) and fill their settings from it: the comment trigger (keywords, posts, dmDelaySeconds), the private reply (text, variations, buttons) and the public reply (text, variations, publicReplyPolicy, secondsAfterTrigger).

Wording

  • variations: other wordings; one is picked per comment, so the same words are not posted again and again.
  • The DM takes any variable. The public reply takes only the commenter's names ({{first_name}}, {{name}}, {{full_name}}, {{username}}): everyone on the post reads it, so publish refuses any other variable.
  • publicReplyPolicy: after_dm (the default) posts the public reply only once the DM went; always posts it whatever happened to the DM.
  • secondsAfterTrigger delays the public reply; it never goes before the DM.

How it behaves

  • It answers only comments made after it was switched on, a late or caught-up comment included.
  • Replies go out in order at each account's pace. A reply your key or AI app sends with reply_to_inbox_comment past that pace answers 202 with status: queued: it is accepted and goes in order. Read get_inbox_comment: replyStatus reads queued (a private reply: privateReplyQueued) until it goes. Never send it again.
  • When the platform refuses an account's messages, its DMs and replies wait rather than fail. get_connection with include=healthCheck shows holds: what waits (scope), why, and until, when they go out on their own.

If it fails

AnswerCauseFix
202 status: queuedThe account's pace or the brand's budget is used for nowNothing: it goes in order. Read get_inbox_comment; never resend.
validate_automation names a variable in the public replyA variable other than the commenter's namesUse only the names above.
400 platform_not_supported on a DMThe channel has no private reply to a commentUse the public reply only.
429 with Retry-AfterToo many requests right nowWait Retry-After (on MCP, details.retryAfterSeconds), then retry with the same idempotencyKey.
Nothing goes, healthCheck.holds lists messagesThe platform refused the account's messagesThey go out at until. See Rate limits.

Try it on real customer chats

Connect Instagram, WhatsApp or any other channel and start replying today.