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. Custom event names must not start with the reserved mailblastr: prefix; the built-in mailblastr:schedule scheduled trigger is the one exception.

trigger_configobjectoptional

The mailblastr:schedule trigger’s schedule — an object { at, timezone } that runs the automation once for every contact in the domain’s audience at that time. at is an ISO 8601 instant that must be in the future and at most 366 days ahead; timezone is the IANA timezone name it was picked in (e.g. America/New_York).

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": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "domain": "yourdomain.com",
  "name": "Welcome series",
  "trigger": "user.created",
  "status": "enabled",
  "trigger_config": null,
  "trigger_key": "start",
  "steps": [
    {
      "key": "start",
      "type": "trigger",
      "config": { "event_name": "user.created", "domain": "yourdomain.com" }
    },
    {
      "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"
}