Comment to DM API for Instagram and Facebook
The comment to DM API answers a matching Instagram or Facebook comment with a private reply. You pick the post and the keywords, write the message with whatever the person asked for, and the automation run history shows what happened afterwards.
Last updated: November 2026
Official APIsDirect engineer support
{ "teamId": "team_123", "name": "Reel checklist lead magnet", "platformScope": "INSTAGRAM", "definition": { "trigger": { "type": "COMMENT_CREATED", "platform": "INSTAGRAM", "socialAccountId": "sa_instagram_1", "postId": "post_456", "keywords": [ "guide", "checklist" ] }, "steps": [ { "type": "SEND_PRIVATE_REPLY", "message": { "text": "Here is your free launch checklist: https://example.com/launch-checklist" } }, { "type": "SEND_PUBLIC_COMMENT_REPLY", "text": "Sent you a DM." } ] }}- customers
- 17,242+
- connected accounts
- 1.09m+
- uptime
- 99.881%
- Trustpilot
- 4.8 / 5
Follow up on campaign comments in private
Keyword rules per post
Each flow watches one post and fires on the words you choose.
Public and private responses
The commenter gets a private reply. A public acknowledgement under their comment is optional.
Execution history
Each run records the comment that started it and the result of every action the flow attempted.
How comment-to-DM automation works
- 01
Publish the campaign post
Create the Instagram or Facebook post through bundle.social. The flow needs the post ID bundle.social returns. - 02
Define the keyword flow
Create a flow for that post with the keywords to match and the private reply to send. - 03
Test and publish the flow
Run a test first. When it looks right, publish that version and follow matching comments in the execution logs.
Example
Comment to DM lead magnet campaign, from post to execution history
Take a Reel that offers a free launch checklist, with the caption “Comment GUIDE and we will DM you the checklist”. Every comment that contains the keyword gets the checklist link in a private reply, and the flow can also post a public acknowledgement under the comment. If the person keeps talking in DMs, further replies fall under the platform’s messaging rules.
bundle.social matches comment keywords as whole words or phrases and ignores case by default: “guide” matches “GUIDE please” but not “guidelines”. Always set keywords on a campaign flow. Without them the flow answers every comment on the post, including the “thanks” people leave under your public acknowledgement.
Meta sets the rules for the private reply. It is plain text with no images, buttons, or quick replies, each comment gets one, and nothing else can be sent until the person answers. Once they answer, the conversation is open and a separate incoming-DM flow can carry it on with buttons or quick replies.
A comment flow points at one bundle.social post, so the easiest time to create it is when you schedule that post. In the dashboard, Create automation on the post opens the flow builder with that post selected. You can publish the flow before the post goes live, and it starts matching comments as soon as the post is up.
| Stage | What happens |
|---|---|
| 1. Schedule the post | POST /api/v1/post schedules the Reel on the connected Instagram account. Keep the post ID from the response. |
| 2. Create the flow | POST /api/v1/automations with a COMMENT_CREATED trigger on that post ID and the keywords guide and checklist. The flow is saved as a draft. |
| 3. Test the steps | Once the post is live, comment GUIDE from a second account you own and send POST /api/v1/automations/:id/test with that comment's fetchedCommentId. A test skips the keyword check and really sends the private reply. |
| 4. Publish the flow | POST /api/v1/automations/:id/publish makes the draft live, and matching comments start runs from then on. To have the flow ready at launch, publish it before the post goes live and check the first real runs in the history. |
| 5. Comments arrive | New comments reach bundle.social in real time, with no comment import to run. A comment containing guide or checklist starts a run. Comments from the account itself or sent through bundle.social never trigger the flow. |
| 6. Read the execution history | GET /api/v1/automations/:id/executions?teamId=team_123 lists runs newest first and can filter by status, such as FAILED. GET /api/v1/automation-executions/:id returns one run with the status and error of every step. The dashboard Logs tab shows the same runs. |
Each comment from someone else also reaches your webhook as a comment.received event, and data.comment.id in it is the fetchedCommentId a test run needs. Execution logs are kept for 30 days. Runs stopped by a limit carry an error code, such as AUTOMATION_MONTHLY_LIMIT_REACHED when the account has used its monthly automation runs.
Example: the lead magnet flow for an Instagram comment keyword
This draft flow watches one Instagram Reel. Its private reply carries the checklist link, and its public reply tells other commenters to check their DMs. Swap the sample team, account, and post IDs for your own.
postId is the ID bundle.social returned when you created the post. The Instagram media ID will not work here. The flow is saved as a draft, so test it on a real comment before you publish it. You can drop the public reply step.
Getting started
Prepare the account and the campaign post
Supported accounts and limits
- A comment flow watches one post or every post on the account, including posts published outside bundle.social.
- When a flow for a single post matches a comment, it runs instead of the account-wide flows.
- Private replies need Meta’s permissions and are bound by its reply rules.
- Data retention policy
FAQ
Questions developers ask before building
Which platforms support comment-to-DM?
Can one flow cover every post on an account?
postId, or pick All posts in the dashboard, and the flow covers every post on the account. A flow for a single post still takes priority when it matches.Can I use posts published outside bundle.social?
Does sending a private reply allow unlimited follow-up?
What happens if the same person comments the keyword twice?
Which plans include DMs and automations?
Build a comment-to-DM campaign
Pick a post, set the keywords, and run a test reply.Message and automation allowances on paid plans are counted per connected account.