Comments to DMAPI

Turn “send me the link” comments into private messages

Create one automation and FoPost watches comments on your Instagram and Facebook accounts. When a comment matches, the commenter gets a private reply in their DMs, held for your approval first unless you say otherwise.

POST /v1/automations
curl -X POST https://api.fopost.com/v1/automations \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "9b2f6c1e-...",
    "name": "Price comments to DM",
    "triggerType": "inbox_message",
    "triggerConfig": { "keywords": ["price", "link"], "types": ["comment"], "maxRunsPerDay": 20 },
    "graph": {
      "nodes": [
        { "id": "t1", "kind": "trigger" },
        { "id": "m1", "kind": "send_message", "config": {
          "channel": "private",
          "text": "Hi {{contact.name}}, here is the link you asked for.",
          "buttons": [{ "title": "Shop now", "url": "https://yourbrand.com/shop" }]
        } }
      ],
      "edges": [{ "id": "e1", "source": "t1", "target": "m1" }]
    }
  }'

Keyword match

Any or all of up to 20 keywords, on comments only or every message type.

Approval first

New automations hold each reply for a person to approve before it sends.

Once per comment

A comment is claimed before the DM goes out, so it is never answered twice.

Trigger

Decide which comments get a message

The inbox_message trigger fires on new comments, mentions, replies, DMs, story replies, and reviews. Narrow it with keywords, message types, specific accounts, or specific posts, and choose to answer only followers or only a person’s first message. Each automation runs at most 3 times a day by default; raise maxRunsPerDay up to 20.

Read the trigger reference
Automations running on a schedule, on a feed and across networks

Per post

postIds limits the automation to comments under the posts you name.

Followers only

followersOnly skips commenters who do not follow the account.

Daily cap

maxRunsPerDay keeps a viral post from sending hundreds of messages.

Message

A private reply, written your way

The send_message step with channel set to private sends the commenter a DM through Meta’s private reply. Use {{contact.name}} and {{message.text}} in the text, add up to 3 link buttons or 13 quick replies, and attach a link that gets UTM tags and a counted redirect. Meta accepts a private reply only within 7 days of the comment, so older comments fail with that reason.

See the send_message step
POST /v1/automations/:id/dry-run
curl -X POST https://api.fopost.com/v1/automations/f2b7d9a4-.../dry-run \
  -H "X-API-Key: $API_KEY"

{
  "would_defer": false,
  "approval_mode": false,
  "steps": [
    { "node_id": "t1", "action_type": "trigger", "status": "completed", ... },
    { "position": 1, "node_id": "m1", "action_type": "send_message", "status": "completed",
      "handle": "out", "error_message": null,
      "output": { "messagePreview": "Hi Jordan, here is the link you asked for.", "channel": "private" } }
  ],
  "drafts": [],
  "total_delay_ms": 0,
  "credits_charged": 0
}

Dry run

Preview the message against a recent comment. Nothing is sent or created.

Tracked links

Clicks are counted and the URL carries utm_medium=dm.

7-day window

Meta’s limit on private replies, checked before any send.

Control

Approve, pause, and audit every run

Unless a step sets requireApproval to false, each reply waits in GET /v1/inbox/approvals until someone approves or rejects it. Toggle the automation on and off with one call, and read its run history to see what fired, what is waiting, and what failed.

Start building
POST /v1/automations/:id/toggle
curl "https://api.fopost.com/v1/inbox/approvals?workspace_id=9b2f6c1e-..." \
  -H "X-API-Key: $API_KEY"

curl -X POST https://api.fopost.com/v1/inbox/approvals/:id/approve -H "X-API-Key: $API_KEY"

curl -X POST https://api.fopost.com/v1/automations/f2b7d9a4-.../toggle -H "X-API-Key: $API_KEY"

{ "id": "f2b7d9a4-...", "active": false }

Run history

GET /v1/automations/:id/runs with status, start time, and any error.

Replay

Rerun a past run after fixing the message or the trigger.

Versions

Every saved change is a version you can view or restore.

Comments to DM questions, answered

Which networks support comment to DM?

Instagram and Facebook. Private replies to comments are a Meta feature, and other networks do not offer an equivalent. The same automation can still answer comments publicly on other networks with channel set to same.

Can the same person get the message twice?

Not for the same comment. The comment is marked before the DM is sent and an automation fires only once per comment, so retries and repeated runs send nothing new.

Does it send without anyone checking?

Not by default. A send_message step created without requireApproval holds every reply for approval. Set requireApproval to false on the step when you are ready for it to send on its own.

What happens to comments older than 7 days?

Meta does not allow a private reply after 7 days, so the run fails with that reason and nothing is sent.

Which API key scopes do I need?

Creating and managing automations needs the automations scope. Listing and approving held replies uses the inbox scope.

Can I start an automation from my own system?

Yes, with a different trigger. An automation with the api_webhook trigger runs when you POST to /v1/automations/:id/trigger with its secret in the x-automation-secret header.

Build on the Comments to DM today

Starting is free and the full API is included. Create a key and make your first call in minutes.

Get your API key