
10 min read
Direct Answer: A comment fires a webhook, your server sends the DM. The real cost is Meta's app review and the upkeep, not the code. When to build, when to buy.
- A comment fires a webhook, your server sends the DM. The real cost is Meta's app review and the upkeep, not the code. When to build, when to buy.
- Authored by Abdullah with actionable, zero-fluff implementation guidance.
- Verified for immediate practical application, production workflows, and professional skill enhancement.
You can build this yourself, and the mechanic is smaller than you would expect. Instagram sends your server a webhook when someone comments on your post, and your server answers that comment with a private message. That is the whole trick, and it is a few hundred lines of code.
The reason people still pay for ManyChat is everything wrapped around those few hundred lines: a Meta app that has passed review, a verified business behind it, a server that stays up, and somebody who fixes it when Meta changes something. If you are sending a modest number of DMs a month, that overhead costs more than the subscription does, and we would tell you to subscribe.
Here is the full shape, so you can make that call yourself.

What actually happens when a comment becomes a DM
Four steps, none of them magic.
- Someone comments on your post or reel.
- Meta sends a POST request to a webhook URL you registered. It contains the comment text, the comment ID, and an ID for the person who wrote it.
- Your code decides whether this comment deserves a reply. Usually that means matching the keyword you put in the caption.
- Your code calls Instagram's messaging endpoint using the comment ID as the recipient. Instagram delivers your message as a DM from your account to that person.
Step four is the part that surprises people. You never need the commenter's username or a separate consent step. Addressing a message to a comment ID is a documented pattern Meta calls a private reply, and it exists precisely because the comment is the opt in. They spoke to you in public, so you may answer them once in private.
That word "once" is carrying weight.
What you need before any of it works
Same list whether you build or buy. The difference is who does the work.
- An Instagram professional account, meaning Business or Creator. A personal account cannot use any messaging API, and there is no workaround.
- A link to a Facebook Page, probably. For years the account had to be connected to a Page, and the access token came from that Page. Meta has since been rolling out a login path that lets a business account authorise an app directly. Which one applies depends on the product you build against, so check the official Meta Instagram Graph API documentation rather than any blog post, ours included.
- A Meta app with the messaging and comment permissions requested. The exact permission names have changed across API versions more than once.
- App Review and business verification, if your app will ever touch an account you do not personally control. Working against your own account with a role on your own app is much lighter. This is the single largest hidden cost of building, governed by the Meta App Review process, and it is measured in weeks of waiting rather than hours of coding.
- A public HTTPS endpoint that answers Meta's verification challenge, responds fast, and stays up. Webhook retries are not infinite.
- Token handling. Tokens expire, and long lived ones still need refreshing. That refresh is what quietly breaks six months later.
Webhooks and token refresh are covered in our free Node.js backend course, if you would rather understand the moving parts than delegate them.
The rules you cannot code around
None of these change because you wrote the code yourself. Building without ManyChat is not building without Meta.
One private reply per comment. Not one per person, one per comment. If somebody comments five times, you may still only privately reply to each comment once.
A time limit on the reply. Meta documents a window from the moment of the comment, measured in days rather than minutes. It has been stable for a long time, but check the current figure before you build retry logic around it.
A separate window once they answer. After the person replies in the DM, ordinary messaging rules take over: free form messages inside a short window, and outside it a message tag such as the human agent one, which exists for a reply a human actually writes rather than an automated send, and has its own longer but still finite limit. Verify both in Meta's docs, because they have moved.
No cold DMs, ever. This system can only answer people who contacted you first. Nothing here reaches an audience that has not interacted with you, and anything sold as doing so is either driving the app through an unofficial client or lying.
Rate limits, which normal traffic will not touch and a viral reel absolutely will.
What the subscription is actually selling
"Just build it" advice usually pretends the tool does nothing. It does plenty.
| What the job needs | Subscription tool | Building it directly |
|---|---|---|
| Meta app and App Review | Already done, you press connect | Yours to complete and wait on |
| Business verification | Theirs | Yours |
| Server and uptime | Theirs | Yours |
| Flow logic | Visual builder, limited to what it can express | Anything you can write |
| When Meta changes the API | Fixed for you, often before you notice | You find out from an error log |
| Where your leads live | Their account, exported on their terms | Your database |
| Cost shape | Recurring, historically scaled by contact count | Build once, then hosting and maintenance |
The contact count row decides most cases. Tools here have generally priced on how many people your automations have touched, with a free tier that caps features and a paid tier that climbs as your list grows. Check the current numbers directly, because they change, but understand the shape: a post that does unusually well raises your bill. That is fine when the automation is making money and painful when it is running a giveaway.
When building it directly is genuinely cheaper
A subscription is a small recurring number. A build is a large one off number plus a small recurring one. So building wins in two situations: the recurring number has grown large, or the tool simply cannot do the thing.
We would build when:
- The reply needs data the tool does not have. Live stock, an order status, a real price from your own system, an actual free slot in your calendar. A visual builder can send a link to your booking page. It cannot tell someone that the blue one in size 40 is gone.
- The DM has to write somewhere that matters. Your CRM, your database, the sheet your sales team really uses. Most tools integrate, but the useful integrations tend to sit on higher tiers, and each one is another subscription.
- Contact based pricing has become the problem rather than the price. If a single viral reel adds thousands of contacts you will never sell anything to, you are now paying rent on strangers.
- You already run a backend and employ someone who maintains it. Then this is a fortnight of work bolted onto infrastructure that already exists, not a project.
We would not build when:
- You post a keyword giveaway once or twice a month. Subscribe. Paying anyone, us included, to develop this for that volume is worse business than the subscription by a wide margin.
- You have nobody to call when it breaks. A broken custom integration on a Saturday is worse than any subscription, because the DMs simply stop and nothing tells you.
- You are still testing whether comment automation works on your audience at all. Prove it on somebody else's infrastructure first. A few weeks on a paid plan is a cheap experiment, and if the answer is no, you have lost a subscription instead of a build.
That last one is the advice we give most often, and it earns us nothing.
The cost nobody puts in the estimate
Maintenance. Meta runs its Graph API on a version deprecation clock, endpoints get replaced, permission names change, tokens expire at inconvenient moments, and webhooks fail silently rather than loudly. When you subscribe, someone else's engineer absorbs all of that. When you build, that person is you or your developer, and the honest way to budget it is as a small permanent line item rather than zero.
This is the strongest argument for subscribing and the one custom development shops tend to skip.
The middle path most businesses should take
Start on a tool. Get the flows right where iterating costs an afternoon rather than a sprint, and watch for the moment the pain becomes concrete: a reply you cannot personalise, an integration you cannot afford, a bill growing faster than the revenue behind it. Then migrate. Comment to DM flows are simple enough to re express in code in days, and you can start the Meta app review while the tool keeps running.
If the real problem is that orders, stock and conversations live in three systems that do not speak, then messaging is not the fix and custom software probably is. We would rather say that than sell you a bot that DMs people about an inventory it cannot see. If you are unsure which case you are in, tell us the volume and we will tell you which way we would go.
Your Bot is our WhatsApp automation, built on Meta's official API and running today. Instagram support is in development. Either way, we will tell you when a subscription would serve you better.
Questions, answered
04 questions
Yes. Meta officially supports Private Replies via the Instagram Graph API. When a user posts a comment on your post or reel, your authorized server can send an automated direct message using the specific comment ID as the recipient.
No, provided you use Meta’s official Graph API with standard app verification and respect rate limits. Account bans occur when creators use unauthorized headless browser tools or unofficial scrapers that simulate human logins.
A custom build makes financial and operational sense when your subscriber contact list exceeds 10,000+ (where ManyChat's monthly contact tiers become expensive), or when your DM replies need live integration with custom databases, ERPs, or real-time warehouse inventory.
Yes. Automated direct messages can deliver downloadable PDF links, discount promo codes, course enrollment pages, or calendar booking invites directly to the user’s inbox within seconds of their comment.


