Comment to DM Automation API
Auto-send a DM when someone comments a keyword on a post, with an optional public reply, all through one API.
- Trigger a DM when a comment matches your keywords
- Send an optional public reply under the comment
- Target one specific 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
One Request. Structured Response.
Clean, predictable JSON that's easy to parse and integrate.
curl -X POST "https://api.postpeer.dev/v1/comment-automations/" \
-H "x-access-key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "INTEGRATION_ID",
"name": "Link in DM",
"postScope": "specific",
"platformPostId": "17901234567890123",
"keywords": ["link", "guide"],
"matchMode": "word",
"publicReplies": ["Sent you a DM!"],
"dmMessage": "Here is the link you asked for: https://example.com"
}'{
"success": true,
"automation": {
"id": "AUTOMATION_ID",
"platform": "instagram",
"name": "Link in DM",
"status": "active",
"trigger": {
"postScope": "specific",
"platformPostId": "17901234567890123",
"keywords": ["link", "guide"],
"matchMode": "word",
"excludeKeywords": []
},
"actions": {
"publicReplies": ["Sent you a DM!"],
"dmMessage": "Here is the link you asked for: https://example.com"
}
}
}Why Choose PostPeer
Build the comment-to-DM automation your users need while PostPeer handles the platform-specific complexity behind it.
Keyword-Triggered DMs
Set trigger words like `link` or `guide`. When a new comment matches, PostPeer automatically sends the commenter your DM. Leave keywords empty to reply to every new comment.
Optional Public Reply
Post a public reply under the comment too, such as "Sent you a DM!". Add up to five alternatives and PostPeer rotates one per comment so the automation doesn't read as a bot.
Any Post or a Specific Post
Run an automation across every post on the account, or bind it to one specific post or reel by its ID. Fetch eligible posts straight from the API.
Match Modes and Exclusions
Match a keyword as a whole word, anywhere in the text, or as the exact comment. Add exclude words to skip comments that should never trigger a DM.
Managed Webhooks and Delivery
PostPeer subscribes the account to comment webhooks and delivers in real time with automatic retries. You never run a webhook server or file your own Meta App Review.
Logs and Stats
Every trigger is logged with the comment, the commenter, and whether the DM and public reply were sent. Track triggered, succeeded, and failed counts per automation.
Automate Comment to DM Across Supported Platforms via One API
Set up keyword-triggered DM automations through one API while PostPeer manages the webhooks, permissions, and delivery behind each supported platform.
Go Beyond Automations. Build the Complete Workflow.
Give your users posting, scheduling, analytics, comments, and messaging through one PostPeer integration.
Posting API
Publish content across supported social platforms through one unified API, with text, images, videos, carousels, and platform-specific options.
Explore the Posting APIComments API
Read, reply to, hide, or delete supported comments directly from your product.
Explore the Comments APIMessaging API
List conversations, read history, and send DM replies through one connected API.
Explore the Messaging APIAnalytics API
Retrieve normalized performance metrics for dashboards, reports, and automated workflows.
Explore the Analytics APIOne Integration. Every Way to Build.
Start with REST, use a typed SDK, connect an automation workflow, or hand the job to an agent. The same PostPeer API powers every path.
REST API
One predictable endpoint for every supported platform. Connect accounts once, then publish everywhere.
No-Code Automation
Build social publishing and scheduling workflows without creating a custom backend.
AI Agents & MCP
Give Claude, Cursor, Codex or your own agent access through hosted MCP, Agent Skills or REST tool calling.
const response = await fetch(
'https://api.postpeer.dev/v1/posts',
{
method: 'POST',
headers: {
'x-access-key': process.env.POSTPEER_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Hello from PostPeer!',
platforms: [
{ platform: 'twitter', accountId: 'acc_twitter' },
{ platform: 'linkedin', accountId: 'acc_linkedin' },
],
publishNow: true,
}),
},
);
const post = await response.json();Frequently 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.