Skip to main content

Updating Scenario & Campaign Actions via API & MCP

How to add, update, and remove individual actions in existing scenarios and campaigns using the Inrō API or MCP.

You can add, change, and remove individual steps in an existing scenario or campaign by sending an actions array to update_scenario or update_campaign (over the API or MCP). The array you send is the complete, authoritative list of actions: anything you leave out is removed. That gives you full, predictable control over the structure in a single call.

How it works

Each action in your payload follows one of three patterns:

  • { "id": 123 } keeps that action exactly as it is. Nothing changes.

  • { "id": 124, "content": "New message" } updates only the fields you provide. Everything else stays the same.

  • No id creates a brand-new action. It must include an action_key and reference a parent with parent_key or parent_id.

Any existing action whose id is not in the list is destroyed. The same rule applies to triggers: include every trigger you want to keep.

Reference parent actions

Every non-root action declares its parent, in one of two ways:

  • parent_id uses the database ID of an action that already exists (and is in the list via its id). Best when the parent is already there.

  • parent_key uses the action_key of another action in the same payload. Best when the parent is a new action you're creating in the same call.

parent_id and parent_key are mutually exclusive. Both are validated before anything is saved, so if a reference doesn't resolve, the whole update is rejected and nothing changes.

Example: add a follow-up step

{  "actions": [    { "id": 123 },    {      "action_type": "message",      "action_key": "followup",      "parent_id": 123,      "content": "Thanks for your reply!"    }  ]}

Action 123 is kept unchanged. A new "followup" message is created as its child. Any other actions that were in the scenario are removed.

Example: update one field

{  "actions": [    { "id": 123, "content": "Updated message text" },    { "id": 124 }  ]}

Only the content of action 123 changes. Action 124 is kept as-is. All other existing actions are removed.

🐾 Netsuke's Tips

  • Always include every action you want to keep, even the ones you're not changing. Omitting an action deletes it.

  • Call get_scenario or get_campaign first to pull the current action IDs, then build your update from that. It's the safest way to avoid deleting something by accident.

  • Over MCP, the same complete-list rule applies, but a few inline objects are API-only. See Build and Update Automations Programmatically via API & MCP for the inline survey/folder limits.

What's next?

Did this answer your question?