Create a comment-to-DM automation (draft)
create_comment_to_dmThe most common automation: when someone comments on a post, DM them. Creates a draft; nothing goes out until enable_automation. How Meta works: a DM cannot be started by the account. The only automatic door is a private reply to a comment, one per comment, within 7 days of the comment, and once the person answers the 24-hour window opens for the rest. Instagram can check whether the person follows the account (requireFollow); Facebook cannot, so requireFollow is rejected there. Threads has no DMs at all; use create_automation with comment_public_reply. A file to deliver: if it already has a public https link that returns the file itself (jpeg, png, gif, webp, mp4, mov or PDF), pass it as deliver.fileUrl and it goes to the person as-is; the link is opened once on save and a web page (a Google Drive or Dropbox share page), a private address or a dead link is rejected. If the file has no public link, upload it to Uplika first (media_upload_link without a shell, media_presign then media_complete with one) and pass deliver.mediaId (photos, videos, PDF or HWP/HWPX documents; on Instagram a document other than PDF goes as a download link, because Instagram DMs attach PDF only). Not both. post can be our post id, the post's own id on the platform, a link to the post, "any" for every post, or "next" for the next post you publish (or pass automation on publish to do both in one call). Only one enabled automation per account can wait for "next" (409 next_post_taken). Order when everything is on: opening DM (message + button) -> askEmail -> requireFollow -> deliver (text, up to three link buttons, file; clicks are tracked) -> followUp if no link was clicked. openingDm:false sends deliver as the private reply itself; then requireFollow, askEmail, followUp and files are rejected because the window never opens. The optional public reply under the comment is fixed sentences (publicReply) or written by the AI for each comment (publicReplyMode: "ai" with publicReplyInstruction); either way it is posted only after the private reply went out, and the AI is told a DM was sent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| post | Yes | Our post id, the platform post id, a link to the post, "any", or "next". | |
| match | No | ||
| deliver | Yes | What to send after the tap: text, up to three link buttons, and/or one file (fileUrl or mediaId). | |
| enabled | No | Default false. Prefer leaving it off and calling enable_automation after the person confirms. | |
| message | No | The opening DM (private reply). One message. Required unless openingDm is false. | |
| askEmail | No | Ask for their email after the tap and store it in contact field `email`. Three tries, then continue without. | |
| followUp | No | Sent followUpAfterMinutes later if none of deliver.links was clicked. Needs openingDm and at least one link. | |
| keywords | No | Trigger words in the comment. Empty means every comment. | |
| accountId | Yes | Connected Instagram or Facebook account id from list_accounts. | |
| openingDm | No | Default true. false: deliver goes out as the private reply itself (no button, no window afterwards). | |
| emailRetry | No | ||
| buttonTitle | No | Button under the opening DM, at most 20 characters. | |
| likeComment | No | Like the comment first. Instagram accounts connected through Facebook only. | |
| publicReply | No | Optional public replies under the comment, one picked at random. Posted after the private reply goes out, and skipped when it could not be sent, so a reply saying a DM was sent stays true. | |
| workspaceId | No | Which workspace this is for. Only needed when the account has more than one — the error tells you the ids when it matters. Leave it out if it is already decided; do not ask the person again. | |
| emailMessage | No | ||
| recheckTitle | No | ||
| requireFollow | No | Instagram only. Deliver only to followers; others are asked to follow and check again. | |
| publicReplyMode | No | fixed (default) uses publicReply. ai: the AI writes the public reply for each comment in the channel's persona; needs publicReplyInstruction. Counts toward the daily AI limit. | |
| notFollowingMessage | No | ||
| followUpAfterMinutes | No | 1 to 1380 (23 hours). Default 60. | |
| publicReplyInstruction | No | With publicReplyMode ai: what the public reply should say. DM contents (links, codes, prices) are never repeated in public. |