Developers · DM automations API

The Instagram DM automation API.A keyword in, a conversation out.

Breakreach's DM automation API creates flows on an Instagram account with POST /v1/dm-automations: when someone DMs a keyword, mentions the account in a story, replies to a story or opens a ref link, Breakreach answers in their DMs and walks the steps you set (messages with a link button or choices, waits, a follow check, a handoff to your team), inside Meta's 24-hour window.

OpenAPI spec

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

curl https://api.breakreach.com/v1/dm-automations \  -H "Authorization: Bearer $BREAKREACH_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "accountId": "6701a2f4c9e84b0012a3b4c5",    "trigger": { "type": "keyword", "keywords": ["guide"] },    "steps": [{      "type": "condition", "check": "follows",      "yes": [{ "type": "message", "text": "Here it is!",                "button": { "title": "Open the guide",                            "url": "https://northbeam.coffee/guide" } }],      "no":  [{ "type": "message", "text": "Follow us first",                "choices": [{ "label": "I followed" }] }]    }]  }'
POST /v1/dm-automationsSending
{  "automation": {    "id": "6704a2c9e1b84f0012d3c5a1",    "platform": "instagram",    "name": "DM: guide",    "trigger": { "type": "keyword", "keywords": ["guide"], "match": "contains" },    "reentry": "once",    "active": true,    "stats": { "started": 0, "completed": 0, "handedOff": 0, "clicks": 0 }  }}
maya.brews
Direct message to @northbeam.coffee
GUIDE please 🙏
Here it is @maya.brews! The Morning Light brew guide ☕️
Sent on Instagram
Message…
A follow-to-get-the-link automation on an Instagram account, then its runs: the DM, the follow check, the message with its button, and the click.

DM automations API endpoints5 endpoints, one API key.

  • GET/v1/dm-automationsThe workspace's automations with their stats and, for ref links, the link to share
  • POST/v1/dm-automationsCreate one; subscribes the account to Meta's message webhooks
  • PATCH/v1/dm-automations/:idChange the trigger or the steps, or pause with active false
  • DELETE/v1/dm-automations/:idDelete it with its runs; people in the flow stop
  • GET/v1/dm-automations/:id/runsEach person who went through it, every step, and how it ended

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 an automation takes

FieldTypeWhat it does
accountIdstring, required on createThe Instagram account (or Facebook Page), from GET /v1/accounts
trigger.typekeyword, any_message, story_mention, story_reply or refWhat starts it
trigger.keywordsstring[]Up to 20, for keyword (required) and story_reply (optional); case and accents ignored
trigger.refstringFor ref: the code in ig.me/m/<username>?ref=<code>
stepsstep[], required on createmessage, wait, condition or handoff; a step that branches is the last of its list
reentryonce or alwaysonce (default): a person goes through it once; always: again after cooldownHours
activebooleanfalse pauses it and lets the people in the flow go

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

NetworkDM automationsTriggers
InstagramYes, Professional accountsKeyword, any DM, story mention, story reply, ref link
Facebook Pages (Messenger)Waiting on Meta's reviewKeyword, any DM, ref link
X, TikTok, LinkedIn, WhatsAppNoNot supported
Checked on October 7, 2026, against Breakreach's automation code and Meta's Instagram messaging documentation. Messenger works for app testers until Meta approves one Page permission.

How does a DM start a flow?Meta's webhook, then the steps.

Creating an automation subscribes the account to Meta's message webhooks. Every DM, quick reply tap, story mention, story reply and ref link reaches Breakreach within seconds. If the person isn't already in a flow on that account, the matching automation starts a run for them: a ref link goes to its automation, a story mention or reply to theirs, then keywords (exact before contains), then any DM.

A run walks the steps: it sends a message, waits, waits for a tap or a reply, checks a condition and follows a branch, until the flow ends or hands off. Each step lands in the run's log, which GET /v1/dm-automations/:id/runs returns.

Which steps can a flow have?

StepWhat it does
messageText up to 1,000 bytes with {username} and {first_name}; a link button (clicks counted) or up to 13 quick-reply choices, each with its own branch
waitUp to 23 hours, so the next message still lands inside the 24-hour window
conditionreplied, keyword (in their reply), clicked (an earlier link button), each waited for up to withinMinutes; follows (Instagram), checked at once
handoffFlags the conversation in the Breakreach Inbox for a person on the team, with a note, and ends the run

Meta never reports a tap on a link button, so the button points to api.breakreach.com/l/…, which counts the click and redirects. Link previews and bots are redirected without being counted.

How does it stay inside Meta's rules?Replies only, within 24 hours, humans first.

Every run starts from something the person did, and nothing is sent first. Before each message, Breakreach checks that their last message is less than 24 hours old; if not, the run ends as window_closed and the message isn't sent. Each person is in one flow at a time per account.

When someone on your team answers by hand, in the Instagram app, Business Suite or the Breakreach Inbox, the person's run stops, and automations leave them alone for 12 hours. A conversation handed off triggers nothing until someone marks it done in the Inbox.

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

dm_automation.started fires when a person enters a flow, dm_automation.handoff when a flow hands them to your team (the place to open a ticket or ping Slack), dm_automation.finished when a run ends for any reason, and dm_automation.failed when Meta refuses a message for good. message.received fires for every DM on an account with an automation; pick it on purpose, it's a firehose.

dm_automation.handoff
{  "event": "dm_automation.handoff",  "timestamp": "2026-10-07T09:44:12.508Z",  "automation": { "id": "6704a2c9e1b84f0012d3c5a1", "name": "Pricing questions" },  "run": { "id": "6704a31f0c9e2a0012f1b6d4", "status": "handed_off", "reason": "handoff", "error": null },  "contact": { "id": "7310449128822150", "username": "nightowl.cafe", "name": null },  "account": { "id": "6701a2f4c9e84b0012a3b4c5", "platform": "instagram" }}

What limits apply?

LimitValueSet by
Reply window24 hours after the person's last messageMeta
Message text1,000 bytes; 640 characters with a link buttonInstagram
Choices per message13, labels up to 20 charactersMeta
Steps per automation40, branches 6 levels deepBreakreach
Longest wait23 hoursBreakreach
Automations per workspace100Breakreach
Runs kept90 daysBreakreach

Transient errors (Meta rate limits, a 5xx) are retried twice. A refusal for good, such as a person who blocked the account, ends the run as failed with the reason.

What does the DM automation 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. Messages and runs aren't counted. An automation needs an active plan or trial on the workspace.

For AI agents

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

From an agent: “when people DM PRICE, ask if it's for a team, send the pricing page to individuals and hand teams to me” becomes one create_dm_automation call in Claude Code, Codex or ChatGPT.

  • list_dm_automationsThe automations and their stats, and an automation's latest runs
  • create_dm_automation“When someone DMs GUIDE, send the guide to followers and ask the others to follow first”
  • update_dm_automationNew keywords, a new step, or pause
  • delete_dm_automationRemoves an automation and its runs

What the dm automations API doesn't do yetSo you know before you build.

  • Message people first: every run answers something the person did
  • Send after 24 hours: Breakreach doesn't use Meta's human agent tag
  • Images, carousels or voice notes in a step: text, a link button or choices
  • WhatsApp, X, TikTok or LinkedIn DMs
  • Continue a Comment to DM private reply into a flow (planned)

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 DM automations API.

Yes. Meta's Instagram API sends messages and quick replies within 24 hours of the person's last message. Breakreach's API wraps it in automations: POST /v1/dm-automations with a trigger and steps, and every matching DM starts the flow.

No. Breakreach's Meta app holds the approved messaging permission and receives the webhooks. Creating an automation subscribes the account; your code creates automations and, if you want, listens to the dm_automation webhooks.

Yes, on Instagram: a condition step with check follows asks Instagram whether the person follows the account, and branches. Pair the no branch with a choice like “I followed” that checks again.

The person's run stops at once, whether you answer in the Instagram app, Business Suite or the Breakreach Inbox, and automations leave them alone for 12 hours.

Not by default: reentry once runs it one time per person. With reentry always, they can start it again after cooldownHours (24 by default).

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.