Skip to main content

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
No credit card required.
POST https://api.postpeer.dev/v1/posts
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
Published
2 platforms
TwitterLinkedIn
All posts delivered
Scheduled
queue
12
Queued
847
Sent
Next: in 15 min
Platforms
connected
XLIFBTT
One API, every platform
DF

"I was up and running on six different platforms in under 30 minutes. Strongly recommend!"

David Flor, Founder at Darklight Interactive

Divanshu KhatterMarketing Manager at Sembark

"Couldn't figure out the official Pinterest API. PostPeer was smooth. Using it daily."

Divanshu Khatter, Marketing Manager at Sembark

Het TikawalaFounder at Kalizzle AI Studio

"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.

POSTRequest · Create Automation
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"
 }'
202Response · Create Automation
{
    "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

View the PostPeer documentation

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.

Ship 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.

No Code

Trigger publishing workflows from tools your team already uses.

Setup guides

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 MCP

Beyond Instagram: Every Supported Platform

Start with Instagram, then reach every other network through the same API.

You're here

Instagram API

Publish to Instagram via one API.

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.