Developers · Comment to DM API

The Instagram comment to DM API.A keyword in the comments, a DM in return.

Breakreach's comment to DM API creates keyword rules on an Instagram account with POST /v1/comment-dm-rules: when someone comments the keyword on the post (or any post), Breakreach sends them your DM through Instagram's private replies within seconds, and can reply under the comment. Each DM comes back to you as a comment_dm.sent webhook.

OpenAPI spec

Checked against the API code on October 7, 2026. Breakreach is our product.

curl https://api.breakreach.com/v1/comment-dm-rules \  -H "Authorization: Bearer $BREAKREACH_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "accountId": "6701a2f4c9e84b0012a3b4c5",    "mediaId": "18047212345678901",    "keywords": ["guide"],    "dmText": "Here's the Morning Light brew guide: https://northbeam.coffee/guide",    "publicReplies": ["Sent! Check your DMs"]  }'
POST /v1/comment-dm-rulesSending
{  "rule": {    "id": "6703f0a1c2d94e0012c8a7b2",    "accountId": "6701a2f4c9e84b0012a3b4c5",    "platform": "instagram",    "mediaId": "18047212345678901",    "keywords": ["guide"],    "match": "contains",    "active": true,    "stats": { "triggered": 0, "sent": 0, "failed": 0 }  }}
Morning Light launch
@northbeam.coffee
Comment has “guide”
maya.brewsnow

GUIDE please

northbeam.coffee

Sent! Check your DMs

northbeam.coffee
Replied to your comment
Here's the Morning Light brew guide: https://northbeam.coffee/guide
Sent as a private reply
A rule on the launch post of an Instagram account, then its activity: the comment, the DM sent as a private reply, and the public reply under the comment.

Comment to DM API endpoints6 endpoints, one API key.

  • GET/v1/comment-dm-rulesThe workspace's rules, with their stats; filter by accountId or mediaId
  • POST/v1/comment-dm-rulesCreate a rule; subscribes the account to Instagram's comment webhooks
  • PATCH/v1/comment-dm-rules/:idChange keywords, message, replies or post, or pause with active false
  • DELETE/v1/comment-dm-rules/:idDelete a rule and its activity
  • GET/v1/comment-dm-rules/:id/eventsComments that matched, newest first: sent, failed with the reason, or skipped
  • GET/v1/comment-dm-rules/mediaThe account's latest Instagram posts, to pick a mediaId

Base URL https://api.breakreach.com. Every call sends your key as Authorization: Bearer br_…; errors answer { "error": "…" } with a 4xx or 5xx status. Every parameter is in the OpenAPI spec.

What a rule takes

FieldTypeWhat it does
accountIdstring, required on createThe Instagram account, from GET /v1/accounts
mediaIdstring or nullThe post or reel to watch; left out or null, every post of the account
postIdstringInstead of mediaId: a Breakreach post published on that account
keywordsstring[]Up to 20 words or phrases; empty, every comment triggers the rule
matchcontains or exactcontains (default): the keyword as a whole word; exact: the comment is the keyword
dmTextstring, required on createUp to 1,000 characters, links allowed; {username} becomes the commenter's @handle
publicRepliesstring[]Up to 5 replies under the comment, one picked at random, posted once the DM is sent
activebooleanfalse pauses the rule; true by default

Which networks it coversChecked against the code, not a feature list.

NetworkComment to DMRule
InstagramYes, Professional accountsPublic account; within 7 days of the comment
Facebook PagesNoPlanned
TikTok, YouTube, X, LinkedIn, ThreadsNoTheir APIs can't answer a comment in private
Checked on October 7, 2026, against Breakreach's Comment to DM code and Meta's private replies documentation. Instagram only shares the comments of public professional accounts.

How does a comment become a DM?Instagram's webhook, then a private reply.

Creating a rule subscribes the Instagram account to Instagram's comment webhooks. From then on, every new comment reaches Breakreach within seconds. Breakreach skips the account's own comments (including the public replies it posts), checks the account's active rules, and sends the DM as a private reply: POST /me/messages with the comment id as the recipient, the endpoint Meta documents for answering a comment in private.

You don't run a server or a Meta app for any of this. Your side is the rule, and if you want to react to each DM, a webhook.

How are keywords matched?

Case and accents are ignored, so guide matches GUIDE and Guidé. With contains, the keyword must stand as a whole word or phrase: link matches “link please” but not “linkedin”. With exact, the comment must be the keyword alone, give or take punctuation, spaces and emoji around it. Emoji work as keywords too.

Instagram allows one private reply per comment, so one rule answers each comment. A rule on the post comes before a rule on every post, then the oldest rule wins. A person gets one DM per rule: their next comments are recorded as skipped, with the reason duplicate.

Which webhook events come with it?Three, signed like every Breakreach webhook.

comment_dm.sent fires after each DM, with the comment, the commenter and the text sent: the place to push a new lead into a CRM or a newsletter. comment_dm.failed carries Instagram's refusal in plain words. comment.received fires for every comment on an account with Comment to DM set up, matched or not. Pick them when you add the webhook in Settings, API & MCP.

comment_dm.sent
{  "event": "comment_dm.sent",  "timestamp": "2026-10-07T09:41:06.301Z",  "rule": { "id": "6703f0a1c2d94e0012c8a7b2" },  "comment": {    "id": "17998451230012345",    "text": "GUIDE please",    "mediaId": "18047212345678901",    "from": { "id": "7310449128822150", "username": "maya.brews" }  },  "account": {    "id": "6701a2f4c9e84b0012a3b4c5",    "platform": "instagram",    "displayName": "@northbeam.coffee"  },  "dm": {    "messageId": "aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6MTc4",    "text": "Here's the Morning Light brew guide: https://northbeam.coffee/guide"  },  "publicReply": { "id": "18034766512098765", "text": "Sent! Check your DMs" }}

What limits apply?

LimitValueSet by
Private replies per comment1Instagram
Time to send it7 days after the commentInstagram
Private replies per hour750 per account; Breakreach sends up to 700 and queues the rest for the next hourInstagram, Breakreach
DMs per person1 per ruleBreakreach
Rules per workspace100Breakreach
Activity kept90 daysBreakreach

Transient errors (Instagram rate limits, a 5xx) are retried twice. A refusal for good, such as a person who turned off messages, is recorded as failed with the reason, and the person can get the DM from a later comment.

What does the comment to DM API cost?

The Developer plan costs $5 a month per connected account up to 20, $3 from 21 to 100 and $2 after that, never per call or per post. The API also comes with every regular plan, from Starter at $29 a month for 5 accounts. DMs aren't counted. A rule needs an active plan or trial on the workspace: without one, matching comments are recorded as skipped with the reason plan.

For AI agents

Agents get the same calls.As MCP tools, no code to write.

From an agent: “set up a comment to DM on the reel I published this morning and tell me tomorrow how many DMs went out” works in Claude Code, Codex or ChatGPT, and create_comment_dm_rule takes the Breakreach post id, so the agent doesn't need the Instagram one.

  • list_comment_dm_rulesThe rules and their stats, and a rule's latest activity
  • create_comment_dm_rule“When people comment GUIDE on my last reel, send them the guide”
  • update_comment_dm_ruleNew keywords, a new message, or pause
  • delete_comment_dm_ruleRemoves a rule and its activity

What the comment to DM API doesn't do yetSo you know before you build.

  • Facebook Pages, TikTok and the other networks: Instagram only for now
  • Buttons, several messages or follow-up sequences: one text DM per comment
  • Comments older than 7 days: Instagram refuses a private reply after that
  • Story replies and comments during a live

The rest of the API (webhooks, workspaces per customer, connect links for your users, the price per connected account) is on the developers page.

FAQ

Questions, answered.

Short answers about the Comment to DM API.

Yes. Meta's Instagram API has private replies, which send a DM in answer to a comment. Breakreach's API wraps them in rules: POST /v1/comment-dm-rules with the account, the post and the keywords, and every matching comment gets the DM.

No. Breakreach's Meta app holds the approved permissions and receives Instagram's comment webhooks. Creating a rule subscribes the account; your code only creates rules and, if you want, listens to the comment_dm.sent webhook.

GET /v1/comment-dm-rules/media?accountId=… lists the account's latest posts with their ids. For a post published with Breakreach, pass its Breakreach id as postId instead. Leave both out to cover every post.

GET /v1/comment-dm-rules/:id/events lists every matching comment with its status, and the comment_dm.sent webhook fires as each DM goes out. Failures carry Instagram's reason in plain words.

No. Each person gets one DM per rule, however many times they comment. Their next comments show as skipped with the reason duplicate.

Instagram
TikTok
LinkedIn
YouTube
X
Facebook
Threads

Your first call is five minutes away.From $5 a month per account.

Billed per connected account. Cancel anytime.