Instagram Comment to DM Automation API
Auto-send a DM when someone comments a keyword on your Instagram post or reel, with an optional public reply, all through one API.
- Trigger a DM on comments that match your keywords
- Add an optional public reply under the comment
- Automate one post or every post on the account
- Real-time delivery through managed webhooks, no App Review on your side
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
"I was up and running on six different platforms in under 30 minutes. Strongly recommend!"
David Flor, Founder at Darklight Interactive
"Couldn't figure out the official Pinterest API. PostPeer was smooth. Using it daily."
Divanshu Khatter, Marketing Manager at Sembark
"Great integration experience. Jonathan ships fixes within hours. Mad respect for the speed."
Het Tikawala, Founder at Kalizzle AI Studio
Add Social Media to Your Product in Three Steps
Connect once, then publish, schedule, and read data through the same API.
01
Get Your API Key
Sign up and get your API key instantly. No sales calls or complicated setup.
02
Integrate in Minutes
Connect once to PostPeer to publish, schedule, analyze, manage comments, and handle messages.
03
Support Every Major Platform
Give your users access to major social platforms without building and maintaining each integration yourself.
New to PostPeer? Read the getting started guide
Explore Requests and Responses by Format
Use the same endpoint and change only the fields required for each publishing format.
curl -X POST "https://api.postpeer.dev/v1/comment-automations/" \
-H "x-access-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"accountId": "acc_ig_biz_789",
"name": "Link in DM",
"postScope": "specific",
"platformPostId": "17901234567890123",
"keywords": ["link", "guide"],
"matchMode": "word",
"publicReplies": ["Sent you a DM!"],
"dmMessage": "Here is the link: https://example.com"
}'{
"success": true,
"automation": {
"id": "AUTOMATION_ID",
"status": "active",
"trigger": { "postScope": "specific", "keywords": ["link", "guide"], "matchMode": "word" },
"actions": { "publicReplies": ["Sent you a DM!"], "dmMessage": "Here is the link: https://example.com" }
}
}Explore Instagram Comment to DM API Requests and Responses by Action
Everything You Need for Instagram Comment to DM
Automate comment-to-DM workflows without building Meta's webhooks, keyword matching, and messaging integration yourself. One API for creating, running, and tracking automations.
Keyword-Triggered DMs
Set trigger words like `link`, `price`, or `guide`. When a new comment matches, PostPeer sends the commenter your DM automatically. Leave keywords empty to reply to every new comment on the post.
Optional Public Reply
Post a public reply under the comment too, such as "Check your DMs!". Add up to five alternatives and PostPeer picks one per comment so the automation reads naturally.
Target a Post or the Whole Account
Bind an automation to one Instagram post or reel by its ID, or run it across every post on the account. Fetch eligible posts from the list-posts endpoint.
Match Modes and Exclude Words
Match keywords as a whole word, anywhere in the comment, or as the exact text. Add exclude keywords to skip comments that should never trigger a DM.
Managed Webhooks
PostPeer subscribes the Instagram account to comment webhooks and delivers each DM in real time with retries. No webhook server and no Meta App Review on your side.
Logs, Stats, and Pause
Every run is logged with the comment, commenter, and delivery status. Track triggered, succeeded, and failed counts, and pause or resume any automation instantly.
Need More Than Automations?
Add publishing, scheduling, analytics, comments, and messaging to the same connected Instagram workflow.
Instagram Comments
List comments and replies, create top-level comments, reply, hide, and delete comments through PostPeer.
Explore Instagram CommentsInstagram Messaging
List conversations, read message history, and send DM replies through PostPeer.
Explore Instagram MessagingInstagram Posting
Publish feed posts, reels, carousels, and stories to Instagram through PostPeer.
Explore Instagram PostingInstagram Analytics
Bring supported Instagram performance data into reporting, dashboards, and analytics workflows.
Explore Instagram AnalyticsShip Instagram Comment to DM in Any Stack
Whether your product is a Node app, a no-code workflow, or an AI agent, the same PostPeer API can power the publishing workflow.
Dev Stack
Typed SDKs and predictable REST APIs let you integrate PostPeer into the stack your application already uses.
- Node.js SDK
- Python SDK
- REST + cURL
- TypeScript-first types
AI Agents & MCP
Give Claude, Cursor, Codex, or your own AI agent the ability to publish, schedule, and interact with social workflows through PostPeer.
Connect via MCPBeyond Instagram: Every Supported Platform
Start with Instagram, then reach every other network through the same API.
Instagram API
Publish to Instagram via one API.
Add More Social Capabilities
Use the same connected accounts to schedule, analyze, manage comments, and handle conversations.
Posting API
Publish to every network through one endpoint.
ExploreScheduling API
Queue and deliver posts at the perfect time.
ExploreAnalytics API
Pull engagement and reach metrics into your product.
ExploreComments API
Read, reply to, hide, and manage comments.
ExploreMessaging API
Handle direct-message conversations at scale.
ExploreFrequently Asked Questions
Power Your Next Project With a Unified Social Media API
Give your users posting, scheduling, analytics, and engagement features through one API your team can maintain.
Start with 20 free credits. No credit card required.