Skip to content

Instagram Comment to DM API

The Instagram Comment to DM API lets you auto-send a DM when someone comments a keyword on an Instagram post or reel, with an optional public reply, through one API.

Create Automation Request
curl -X POST "{{API_BASE_URL}}/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"
 }'
Illustrative request
Example line 1

curl -X POST "{{API_BASE_URL}}/v1/comment-automations/" \

Illustrative request
Example line 2

-H "x-access-key: your-api-key" \

Illustrative request
Example line 3

-H "Content-Type: application/json" \

It is built for keyword-triggered DMs: define trigger words, choose whether the automation applies to one post or every post on the account, and let managed webhooks deliver the message in real time.

What the Instagram Comment to DM API does

Use this API when a comment is the signal that a person wants a link, price, guide, or other follow-up in their inbox. Instead of building comment webhooks, keyword matching, and messaging delivery yourself, you create one automation that watches for matching comments and sends the DM automatically. The same workflow can also post a public reply under the comment so other readers see that the follow-up was sent.

Add social media to your product in three steps

Add social media to your product in three steps. First, get your API key by signing up; no sales calls or complicated setup are part of the described flow. Second, integrate in minutes by connecting once to publish, schedule, analyze, manage comments, and handle messages through the same API. Third, support every major platform by giving users access to major social platforms without building and maintaining each integration yourself. Refer to the Create Automation Request and Create Automation 202 Response examples for the exact request and response shape, and to the Create Automation Field Map table for how each field is used.

Create Automation contract sheet

The create-automation call is POST /v1/comment-automations/ and returns a 202 response on success in the supplied example. The request identifies the connected Instagram account with accountId, names the automation, and sets postScope. When postScope is specific, platformPostId binds the automation to one Instagram post or reel by its ID. When postScope is any, the automation runs across every post on the account, and the list-posts endpoint is used to fetch eligible posts. The response echoes the automation id, an active status, the trigger settings, and the actions, including publicReplies and dmMessage. Check the response status and the automation status before treating creation as complete, and keep the returned id for later list, log, pause, update, and delete operations.

Trigger design: keywords, match modes, exclude words, and public replies

Keyword-triggered DMs start with keywords, the trigger words such as link, price, or guide. A matching new comment causes the API to send the commenter the DM automatically. An empty keywords list changes the behavior so that any fresh comment on the post qualifies. Match modes control how keywords are compared: as a whole word, anywhere in the comment, or as the exact text. The supplied example uses matchMode word. Add exclude keywords to skip comments that should never trigger a DM, for example when a comment contains a word that would otherwise cause a false match. For the public reply, publicReplies can hold up to five alternatives, and one is picked per comment so the automation reads naturally. Use specific when a campaign is tied to one post or reel and any when the same keyword should work across the whole account, then verify with logs that the intended comments triggered and unintended comments did not.

Delivery and operations

Delivery uses managed webhooks: the Instagram account is subscribed to comment webhooks and each DM is delivered in real time with retries, so you do not need to run a webhook server and there is no Meta App Review on your side. Each run produces a record showing the comment, who commented, and whether delivery succeeded. Summaries of triggered, succeeded, and failed counts help you spot problems, and any automation can be paused or resumed instantly when a campaign ends or a message needs changing. If deliveries fail, check the logs first for the specific comment and commenter, confirm the automation is not paused, and confirm the account still has the required permissions before retrying or recreating the automation.

Account and permission prerequisites

Comment to DM automations require an Instagram professional Business or Creator account. Personal Instagram accounts cannot use comment or messaging automation. Two permissions must be granted on the connected account: instagram_business_manage_comments, which covers reading comments and posting public replies, and instagram_business_manage_messages, which covers sending the DM. Both are requested during the connect flow. Accounts linked earlier, before those grants existed, should be reconnected once so the newer permissions take effect. A common failure check is therefore simple: if comments are not triggering DMs or public replies are not posting, verify the account type and reconnect to refresh permissions before changing keywords or match settings.

Create Automation Field Map
FieldExample valueType in exampleUse and qualification
accountIdacc_ig_biz_789stringIdentifies the connected Instagram account for the automation.
nameLink in DMstringHuman-readable automation name.
postScopespecificstringControls targeting: specific binds to one post or reel; any runs across every post on the account.
platformPostId17901234567890123stringInstagram post or reel ID used when postScope is specific.
keywords["link", "guide"]array of stringsTrigger words for keyword-triggered DMs. Leave empty to reply to every new comment on the post.
matchModewordstringKeyword matching mode. Prose describes whole word, anywhere in the comment, or exact text; only "word" is shown in the example.
publicReplies["Sent you a DM!"]array of stringsOptional public reply alternatives, up to five, with one picked per comment.
dmMessageHere is the link: https://example.comstringDM content sent to the commenter when a comment matches.

Fields and values are exactly as shown in the supplied create-automation example. Requiredness beyond the example and literal enum strings beyond "word" were not supplied and are not inferred here.

Delivery and Operations Failure Checks
OperationWhat to checkFailure signal
DeliveryLogs show comment, commenter, and delivery status; triggered, succeeded, and failed countsFailed count rises or a run is missing from logs
RetriesAutomatic retries on failed delivery attempts via managed webhooksRepeated failures for the same commenter
Pause / resumeAutomation can be paused or resumed instantlyAutomation paused while a campaign is still live
PermissionsAccount is Business or Creator and grants instagram_business_manage_comments and instagram_business_manage_messagesNo triggers or no public replies after reconnecting the account once

Operations details are as described in the source prose; exact request/response contracts for list, logs, pause/update, and delete were not supplied.

Frequently asked questions

What type of Instagram account is required?

Use a professional Instagram account, either Business or Creator, linked through the API. Personal profiles are not eligible for comment or messaging automation.

Which permissions does it need?

Two permissions are needed: instagram_business_manage_comments, which covers reading comments and posting public replies, and instagram_business_manage_messages, which covers sending the DM. Both are requested when you connect. Accounts linked earlier, before those grants existed, should be reconnected once so the newer permissions take effect.

Can I automate a specific post or every post?

Either scope works. For a single post or reel, choose postScope specific and supply platformPostId. For account-wide coverage, choose postScope any. The list-posts endpoint helps you discover which posts are eligible.

Does the DM send instantly?

Delivery is real time. Comment webhooks notify the system as soon as a matching comment arrives, and failed delivery attempts are retried automatically.

How much does an Instagram Comment to DM automation cost?

A triggered DM uses 1 credit. If a public reply is also delivered, that adds 1 credit, charged only on successful delivery. Together, one matched comment with both actions therefore totals 2 credits.

Can I try it without writing code first?

Yes, code is optional. From the dashboard you can configure Comment to DM for an already published post or reel, using the same underlying API your product would call.

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