For the complete documentation index, see llms.txt. This page is also available as Markdown.

Manage DM automations

Inspect, configure, and verify supported DM automation flows, triggers, runs, and logs.

Use DM automations for supported Instagram and Facebook comment or message triggers. Read the DM Automations guide for trigger behavior, limits, gates, and platform restrictions.

Prompt for your assistant:

Set up a Blotato DM automation for the account, trigger, and reply I describe. Review the trigger and reply with me, then apply my requested activation state. Show how I will check its runs and errors.

  1. Call blotato_list_accounts to identify the account.

  2. Call blotato_list_automations to inspect existing flows before creating a duplicate.

  3. Read the automation schema and match the trigger and message to the user's request.

  4. Call blotato_create_automation or blotato_update_automation for the requested flow.

  5. Inspect the returned flow and activation state.

  6. Use blotato_list_automation_runs, blotato_list_automation_logs, and blotato_get_automation_analytics to inspect results.

Create an inactive Instagram example

Use an authenticated connection and the account ID from lookup. This example responds to incoming messages matching the keyword workshop. It does not schedule social posts or generate content on a timer.

Call blotato_create_automation after checking existing automations and confirming the trigger and reply with the user:

{
  "accountId": "98434",
  "platform": "instagram",
  "name": "Workshop message reply",
  "triggers": [{"type": "message-received", "keywords": ["workshop"], "isActive": true}],
  "dmMessage": "Registration closes on October 10.",
  "buttons": [],
  "isActive": false
}

The trigger is enabled within the draft, but the flow remains inactive because isActive at the top level is false. Read automation.id, automation.isActive, and automation.triggers from the MCP result. Creating a draft is not activation.

For REST, send this JSON to POST https://backend.blotato.com/v2/dm-automations with blotato-api-key: YOUR_API_KEY and Content-Type: application/json:

The REST result wraps the saved record in flow, not MCP's automation. Save flow.id. Read it later with GET /v2/dm-automations/RETURNED_FLOW_ID and the authentication header. For Facebook, set the Facebook platform and target and include the selected Page ID. See the automation schema.

Activate and verify

If the user requests activation, call blotato_update_automation with the saved flow ID:

For REST, send this body to PATCH /v2/dm-automations/RETURNED_FLOW_ID. REST requires the patch wrapper, unlike the MCP tool arguments:

Verify the returned activation state. Changes to an already active flow take effect immediately. Do not treat a content update to a live flow as an unpublished draft.

For an authorized test, send the matching message from a different account. Messages sent by the connected account do not start the run. Read the resulting runs with:

For REST, use GET /v2/dm-automations/RETURNED_FLOW_ID/runs?limit=20. Inspect a selected run's logs with blotato_list_automation_logs or GET /v2/dm-automations/RETURNED_FLOW_ID/logs?flowRunId=RUN_ID. A completed test run verifies the tested trigger, not every future event. If no run appears, check account ownership, activation, and trigger matching before creating another flow. Preserve the flow ID and returned error if a write outcome is uncertain.

Later changes

For one trigger's on/off state, use blotato_update_automation_trigger with current flow and trigger IDs. At least one trigger must stay active while the flow is live. Updating flow content or triggers reissues trigger IDs, so read the response before a later trigger update.

For REST, use the DM Automations API. Trigger updates, flow updates, and archive operations have distinct schemas. Sending a test DM or creating a flow does not prove a real trigger run succeeded. Verify runs and logs.

Last updated