Automations

Auto-reply rules for Instagram, Facebook Pages and Threads — comment→DM, DM reply, public reply (first comment) and hide-spam, including multi-step DM flows. Writes need an active plan; up to 20 rules per account.

GET/automationsautomations:read

List rules. Filter to one account with ?accountId=.

responsejson
{ "rules": [ { "id": "…", "connected_account_id": "…", "kind": "comment_dm", "name": "…", "is_enabled": true } ] }
GET/automations/:idautomations:read

Fetch one rule.

responsejson
{ "rule": { "id": "…", … } }
POST/automationsautomations:write

Create a rule for one account. The account platform decides which kinds are allowed (Threads: comment_reply / comment_hide only; Bluesky, Mastodon: comment_reply only, on all posts).

request bodyjson
{
  "connectedAccountId": "<ig/fb/threads account id>",  // required
  "kind": "comment_dm",            // comment_dm | dm_reply | comment_reply | comment_hide
  "name": "Link in DM",            // required, ≤ 80
  "matchMode": "contains",         // contains | exact | any
  "keywords": ["link", "price"],   // ≤ 20, each ≤ 60; required unless matchMode "any"
  "dmText": "Here you go, {first_name|friend} 👉",  // ≤ 1000 (≤ 640 with buttons); DM kinds only
  "dmButtons": [{ "title": "Open", "url": "https://…" }],  // ≤ 3
  "publicReplyText": "{mention} check your DMs!",  // the first comment; ≤ 2200 (Threads, Mastodon ≤ 500; Bluesky ≤ 300)
  "likeComment": true,             // comment rules, Facebook/Instagram: like the comment as the account
  // Variables: {first_name} on Facebook, {username} on Instagram/Threads;
  // {first_name|there} sets a fallback. They also work in flow step texts.
  // Public replies only: {mention} tags the commenter (Facebook @[PSID], Instagram/Threads @handle).
  "disclosureText": "— Automated reply", // appended to every DM, ≤ 80
  "dmTrigger": "message",          // dm_reply only: message | story_reply | story_mention | ad (Facebook/Instagram: came from a click-to-message ad)
  "adIds": [],                     // dmTrigger "ad" only: Ads Manager ad IDs (≤ 50); [] = any ad
  "flow": null,                    // multi-step DM; see below
  "isEnabled": true
}
responsejson
{ "rule": { "id": "…", "kind": "comment_dm", "is_enabled": true } }
PATCH/automations/:idautomations:write

Update a rule. Only the fields you send change — use isEnabled to pause/resume. The account cannot be changed.

responsejson
{ "rule": { "id": "…", … } }
DELETE/automations/:idautomations:write

Delete a rule.

responsejson
{ "id": "…", "deleted": true }
GET/automations/eventsautomations:read

Activity log — why each comment/DM was answered (sent) or skipped. Filter with ?accountId= and/or ?ruleId=; one rule via /automations/:id/events.

responsejson
{ "events": [ { "id": "…", "rule_id": "…", "event_type": "comment", "status": "sent", "skip_reason": null } ] }