You've seen these posts everywhere on Instagram. A creator says "comment LINK and I'll send it to you" and a few seconds later there's a DM sitting in your inbox.
I used to think there was some guy with three phones doing this manually. There isn't. I ended up building this exact feature for my own product, so here's what's actually going on behind it, minus the marketing fluff.
It's not a bot clicking buttons
The old way people did this was with sketchy tools that logged into your account and pretended to be you. That's how accounts get flagged.
The legit way is Meta's official Instagram API. It only works with Business or Creator accounts linked to a Facebook Page, and every permission has to be approved by Meta. No passwords shared anywhere.
The flow, step by step
- Someone comments on your post. Instagram fires a webhook to your server with the comment text, the comment ID and the post ID.
- Your server checks for a keyword. Something as simple as: does this comment contain "link", "price" or "info"? I normalise the text first (lowercase, trim, strip emojis), because people type "Link!!" and "LINK 🔥" and you still want those to match.
- You send a Private Reply. This is the key part. Instagram lets a business send one DM to the person who commented, tied to that specific comment. It has to happen within 7 days of the comment.
- The conversation opens. Once the person replies to that DM, the normal messaging window opens. You can now keep talking to them for 24 hours from their last message.
So the "magic" is just webhook → keyword match → private reply API call.
Stuff that tripped me up
- One private reply per comment. You can't spam someone with five messages because they commented once. Make the first message count.
- The 24-hour window is real. If the user goes quiet, you can't just message them again three days later with a promo. Meta is strict about this, and honestly that's a good thing.
- Webhooks can arrive twice. Store the comment ID and skip anything you've already processed, or people get duplicate DMs and it looks broken.
- Reply to the comment publicly too. A quick "Sent you a DM 👀" under their comment makes other people comment as well. That's where the reach comes from.
Why I bothered building this
I'm an Android dev from India, and a lot of creators and small brands I know were losing leads simply because they couldn't reply fast enough. Someone asks "price?" at 11 pm, nobody answers, and that sale is gone.
So I built HeyDM: keyword triggers on comments and DMs, auto-replies, and lead capture, all on top of the official API. It's been a fun rabbit hole of webhooks, rate limits and edge cases.
If you're building something similar and get stuck on Meta's app review or the webhook setup, drop a comment. Happy to share what worked for me.
Top comments (0)