API Reference

Update Automation

PATCH /automations/:id — rename, enable or disable, re-point the domain or trigger, or replace the connection graph.

PATCH/automations/:id

Updates an automation. Set status to enabled to start creating runs for matching events, or disabled to stop new runs. You can also rename via name, re-point the sending domain or the trigger event, and replace the connection graph via connections. Returns the full updated automation object, including steps and connections.

Body parameters
namestringoptional

A new name for the automation.

statusstringoptional

One of enabled or disabled. Enabling requires at least one step besides the trigger.

domainstringoptional

Re-point the automation at another of your sending domains. Only allowed while the automation is disabled. Re-pointing also moves the contact pool to the new domain's.

triggerstringoptional

Re-point the trigger at a different event name. Only allowed while the automation is disabled. Must not start with the reserved mailblastr: prefix.

trigger_keystringoptional

Optional key for the trigger step in the graph (used by the canvas editor). Only meaningful alongside trigger; defaults to the existing key, or trigger.

connectionsarrayoptional

Replaces the connections between steps. Only allowed while the automation is disabled. Cyclic graphs are rejected.

Structural edits — steps, connections, trigger, and domain — require the automation to be disabled. Disable it first, make your changes, then re-enable it.
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.automations.update('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', { "status": "enabled" });
console.log({ data, error });

Response

{
  "object": "automation",
  "id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
  "audience_id": "aud_3b1c...",
  "domain": "yourdomain.com",
  "name": "Welcome series",
  "trigger": "user.created",
  "status": "enabled",
  "steps": [
    {
      "key": "start",
      "type": "trigger",
      "config": { "event_name": "user.created" }
    },
    {
      "id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
      "key": "welcome",
      "type": "send_email",
      "position": 0,
      "config": {
        "template": { "id": "34a080c9-b17d-4187-ad80-5af20266e535" }
      }
    }
  ],
  "connections": [
    { "from": "start", "to": "welcome", "type": "default" }
  ],
  "created_at": "2026-06-23T10:00:00.000Z",
  "updated_at": "2026-06-23T10:01:00.000Z"
}