Automations

A draft from a blueprint, then validate, publish and send the event. Every call is on this page.

Start

A draft from a blueprint, validated and published, then the event that starts it and the runs it makes.

Open this guide on its own page

An automation is a journey that runs on its own. A trigger starts a run for one contact (your backend sends cart.updated, a contact joins a segment, an email arrives), and blocks send, wait, branch and update the contact until the run reaches an exit. An automation's id starts with atm_ and a run's with run_.

Every step is one REST call with an API key. Drafts need automations:write, publishing automations:publish, sending events events:emit. A draft never sends anything; publishing can. MCP and Unit have every operation. The SDKs and the CLI got automations and events methods in the automations release; if yours is older, update it. A Sending key created before launch can't send events: create a new one.

1. Create a draft from a blueprint

A blueprint builds a common journey from a few params. abandoned-cart: Nudges when the order never completes (24h after the last cart update, with the latest cart). Needs a backend cart.updated event + an order.completed event. GET /v1/automations/blueprints lists every blueprint; to send your own graph, pass definition instead (Automation examples).

cURL
curl -X POST 'https://www.unitpost.com/api/v1/automations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Abandoned cart",
    "blueprint": "abandoned-cart",
    "blueprint_params": {
      "from": "Acme <hello@mail.acme.com>",
      "template_reminder": "tmpl_cart_reminder"
    }
  }'

The answer is the draft (atm_…) and its heads_up[]. heads_up[] lists values that couldn't be checked in this workspace. They are kept: publish refuses the ones that can't send (a sender, template, segment, topic or number) until they're fixed, and a new contact-field key is only a warning.

heads_up codePublishMeaning
sender_not_an_addressRefused until fixedThe sender isn't a full email address.
sender_domain_not_foundRefused until fixedThe sender's domain isn't a domain of this workspace.
sender_domain_unverifiedRefused until fixedThe sender's domain isn't verified yet.
resource_not_foundRefused until fixedNo such template, segment, topic, campaign or SMS number in this workspace.
sms_sender_inactiveRefused until fixedThe SMS number isn't active yet.
contact_field_not_foundAllowedA contact update names a field that doesn't exist; the step would add it as a new custom value.

2. Validate until ok

cURL
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/validate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{}'

Fix every error by its node_id and path and validate again; then read readiness. Codes and readiness: Test and publish an automation.

3. Dry-run it

cURL
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/simulate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sam@acme.com",
    "event_data": {
      "cart_url": "https://shop.acme.com/cart/123"
    }
  }'

4. Publish

cURL
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/publish' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "changelog": "First version"
  }'

5. Send the event

cURL
curl -X POST 'https://www.unitpost.com/api/v1/events' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "cart.updated",
    "email": "sam@acme.com",
    "data": {
      "cart_url": "https://shop.acme.com/cart/123",
      "item_count": 2
    },
    "idempotency_key": "cart-123-v4"
  }'

6. Read the runs

cURL
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/runs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'

Change it later with PATCH /v1/automations/{id}: definition and policy each replace the stored one whole, so read it first. Every operation is below, and in the OpenAPI spec.

Go deeper

The guides explain the rest: How automations work, Build with AI, Examples, Triggers, Blocks, Data and variables, Safety and limits, Testing and going live, Runs and debugging, Events and webhooks, Billing.

Event-driven journeys as versioned JSON graphs: create a draft (blank, from a blueprint, or with a full definition), validate it, publish it, and read the per-run step ledger. Ids are atm_… (automation) and run_… (run). Build in this order: GET /automations/catalog → GET /automations/blueprints → GET /events/definitions → POST /automations → POST /automations/{id}/validate → POST /automations/{id}/simulate → POST /automations/{id}/publish. Publishing, resuming, enrolling, retrying and skipping a wait can send, and need automations:publish.

List automations

GET/api/v1/automations

GET /automations
curl -X GET 'https://www.unitpost.com/api/v1/automations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "automation",
      "id": "id_123",
      "name": "Example",
      "description": "string",
      "status": "draft",
      "pause_reason": "user",
      "published_version": 0,
      "has_draft_changes": false,
      "trigger": {
        "kind": "string",
        "config": {}
      },
      "active_runs": 0,
      "total_runs": 1,
      "failed_runs_30d": 0,
      "last_run_at": "2026-01-01T00:00:00.000Z",
      "archived_at": "2026-01-01T00:00:00.000Z",
      "delete_after": "string",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "heads_up": [
        {
          "code": "sender_not_an_address",
          "node_id": "node_123",
          "field": "string",
          "resource_type": "template",
          "value": "string",
          "message": "string"
        }
      ],
      "warnings": [
        "string"
      ],
      "generated_secrets": [
        {
          "node_id": "node_123",
          "secret": "string"
        }
      ]
    }
  ]
}

Retrieve your workspace's automations (newest first) with status, live/total run counts, 30-day failure count, and the trigger that starts each one. Archived automations are hidden; archived=true lists only them, each with its delete_after. Deleted ones are never listed. Requires the automations:read capability.

Parameters4 fields
FieldTypeDescription
limitinteger · queryMax rows to return (default 20, max 100).
afterstring · queryReturn rows after this id (forward paging).
beforestring · queryReturn rows before this id (backward paging).
archivedboolean · queryWhen true, list only archived automations (switched off, deleted for good at `delete_after` unless unarchived).
Response · 200 fields20 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
200401403

Create an automation draft

POST/api/v1/automations

POST /automations
curl -X POST 'https://www.unitpost.com/api/v1/automations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Abandoned cart",
    "blueprint": "abandoned-cart",
    "blueprint_params": {
      "from": "Acme <hello@mail.acme.com>",
      "template_reminder": "tmpl_cart_reminder"
    }
  }'
Response · 201
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ]
}

Create a DRAFT automation — blank, from a blueprint (blueprint + blueprint_params, see List blueprints), or with a full definition graph (see Block catalog for every block's config and outputs). Nothing goes live until you call Publish. Send an Idempotency-Key header to make retries return the same automation. Leave policy.reEntry out and the trigger decides who can enter again: Contact created, only once ever; Contact updated, every time; Joined segment, once every 30 days; Left segment, once every 30 days; Subscribed to topic, once every 30 days; Unsubscribed from topic, once every 30 days; Email activity, every time; Text received, every time; Custom event, every time; Manual enrollment, every time. A contact has one live run of an automation at a time by default, so an event for someone already in it starts nothing. On a custom-event trigger whose Wait for event, goal or exit rule matches the run's own event data ({{event.data.<key>}}), or that waits for a date in it, each event starts its own run instead, up to 10 at once (maxConcurrentRunsPerSubject, 1 to 10, sets it; readiness asks for it on a custom event, runs_per_person). A draft saves even when it doesn't validate yet; check it with Validate before publishing. Omit layout: the dashboard keeps its arrangement and places new blocks. heads_up[] lists values that couldn't be checked in this workspace. They are kept: publish refuses the ones that can't send (a sender, template, segment, topic or number) until they're fixed, and a new contact-field key is only a warning. Codes: sender_not_an_address (publish refuses it), sender_domain_not_found (publish refuses it), sender_domain_unverified (publish refuses it), resource_not_found (publish refuses it), sms_sender_inactive (publish refuses it), contact_field_not_found (a warning). The examples are complete bodies that validate; swap in your own ids and sender. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
Idempotency-Keystring · headerAny unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
Request body7 fields
FieldTypeDescription
namestring—
descriptionstring—
blueprintstring—
blueprint_paramsobject—
allow_missing_paramsbooleanWith `blueprint`: leave params you don't pass empty in the draft instead of answering 422 (defaults still fill durations and event names). Validate lists what's left to fill. Default false.
definitionobject—
policyobject—
Response · 201 fields20 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
201401403422

List blueprints

GET/api/v1/automations/blueprints

GET /automations/blueprints
curl -X GET 'https://www.unitpost.com/api/v1/automations/blueprints' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "automation_blueprint",
      "key": "string",
      "title": "string",
      "description": "string",
      "summary": "string",
      "starts_when": "string",
      "channels": [
        "email"
      ],
      "needs": [
        "string"
      ],
      "steps": 0,
      "params": [
        {
          "name": "Example",
          "label": "string",
          "kind": "string",
          "default": "string"
        }
      ],
      "policy": {}
    }
  ]
}

Pre-made journeys (welcome series, abandoned cart, win-back, …) you can create from, with the params each needs — template/topic/segment ids, event names, durations, and the universal from sending identity for any blueprint that sends email. Requires the automations:read capability.

Response · 200 fields11 fields
FieldTypeDescription
objectrequiredstring—
keyrequiredstring—
titlerequiredstring—
descriptionrequiredstring—
summaryrequiredstringWhat it does, in one plain sentence.
starts_whenrequiredstringWhen it starts, in words.
channelsrequiredenum[]The channels its steps send on (empty: it only updates data).
needsrequiredstring[]What has to exist before it can go live (a verified sender, templates, a segment, events from your backend).
stepsrequiredintegerSteps after the trigger, exits not counted.
paramsrequiredobject[]—
policyrequiredobject | null—
200401403

Block catalog

GET/api/v1/automations/catalog

GET /automations/catalog
curl -X GET 'https://www.unitpost.com/api/v1/automations/catalog' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "limits": {
    "max_blocks_per_automation": 0,
    "max_action_steps_per_run": 0,
    "runs_per_contact_per_hour": 0,
    "runs_without_contact_per_hour": 0,
    "marketing_emails_per_contact_per_day": 0,
    "marketing_sms_per_contact_per_day": 0,
    "max_wait_days": 0,
    "max_run_lifetime_days": 0,
    "max_active_runs_per_automation": 0,
    "max_live_runs_per_workspace": 0,
    "backfill_max_contacts": 0,
    "backfill_per_minute": 0,
    "archive_retention_days": 0,
    "max_event_names": 0
  }
}

Every block kind an automation graph can contain: its config fields (required/optional, allowed values, meaning), its outputs (readable by later blocks as steps.<node_id>.output.<key>), and its outgoing handles — plus the condition operators and run-context path scopes. Read this before authoring a definition. With automation_id and node_id it adds paths: the exact data paths that block may read (your custom contact fields, the event's payload keys your backend has sent, earlier blocks' outputs). limits is every automation limit in force now (blocks per graph, action steps per run, runs per contact an hour, the frequency cap's defaults, the longest wait and run, runs in progress, backfill size and pace, archive retention, event names). Requires the automations:read capability.

Parameters3 fields
FieldTypeDescription
automation_idstring · queryWith `node_id`: the automation whose block's readable `paths` to add.
node_idstring · queryWith `automation_id`: the block id in its graph.
sectionstring · query`paths` returns only the block's paths; `blocks` only the blocks.
Response · 200 fields1 field
FieldTypeDescription
limitsobjectThe automation limits in force now (staff can change the runtime ones without a deploy): validate, publish and the engine check against these numbers.
200401403404422

Retrieve an automation

GET/api/v1/automations/{id}

GET /automations/{id}
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ],
  "draft_definition": {
    "schemaVersion": 1,
    "trigger": {
      "id": "id_123",
      "kind": "string",
      "label": "string",
      "config": {}
    },
    "nodes": [
      {
        "id": "id_123",
        "kind": "string",
        "label": "string",
        "config": {}
      }
    ],
    "edges": [
      {
        "id": "id_123",
        "from": "you@yourdomain.com",
        "fromHandle": "string",
        "to": "customer@example.com"
      }
    ],
    "layout": {}
  },
  "published_definition": {
    "schemaVersion": 1,
    "trigger": {
      "id": "id_123",
      "kind": "string",
      "label": "string",
      "config": {}
    },
    "nodes": [
      {
        "id": "id_123",
        "kind": "string",
        "label": "string",
        "config": {}
      }
    ],
    "edges": [
      {
        "id": "id_123",
        "from": "you@yourdomain.com",
        "fromHandle": "string",
        "to": "customer@example.com"
      }
    ],
    "layout": {}
  },
  "policy": {
    "reEntry": "never",
    "reEntryInterval": "string",
    "maxConcurrentRunsPerSubject": 0,
    "maxActiveRuns": 10000,
    "maxStepsPerRun": 0,
    "maxSendsPerSubjectPerDay": 0,
    "maxSmsPerSubjectPerDay": 0,
    "maxRunDuration": "string",
    "quietHours": {
      "start": "string",
      "end": "string",
      "tz": "contact",
      "timezone": "string"
    },
    "exitConditions": {},
    "goal": {
      "eventType": "string",
      "filter": {},
      "window": "string"
    },
    "onError": "pause_run"
  },
  "policy_defaults": [
    "string"
  ]
}

The automation with its draft graph, the graph currently live (if published), and its policy. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields24 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
draft_definitionrequiredobject | null—
published_definitionrequiredobject | null—
policyrequiredobject—
policy_defaultsstring[]The `policy` fields this automation didn't set: their values come from defaults (the trigger's, the graph's, or the platform limits) and move when those do. Sending one back in `policy` makes it a choice: it stops following the default, and on a custom event a `maxConcurrentRunsPerSubject` sent back answers readiness `runs_per_person` though nobody was asked. To change other settings, send the policy without these fields.
200401403404

Update an automation draft

PATCH/api/v1/automations/{id}

PATCH /automations/{id}
curl -X PATCH 'https://www.unitpost.com/api/v1/automations/atm_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "policy": {
      "reEntry": "once_per_interval",
      "reEntryInterval": "P7D",
      "maxConcurrentRunsPerSubject": 1,
      "goal": {
        "eventType": "order.completed",
        "window": "P2D"
      },
      "maxSendsPerSubjectPerDay": 1
    }
  }'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ]
}

Edit the name, description, DRAFT definition, or policy. Edits never change status or affect in-flight runs — publish to make them live. Validate first with Validate. definition and policy each replace the stored value whole: read the automation first and send it back changed. A policy field left out goes back to its default, so a goal or re-entry you don't resend is dropped; leave policy out to keep it. Keep a block's id when you change its settings: on a live automation a new id is a removed block for the people waiting on it. An omitted reEntry goes back to the trigger's default. A draft saves even when it doesn't validate yet; check it with Validate before publishing. Omit layout: the dashboard keeps its arrangement and places new blocks. heads_up[] lists values that couldn't be checked in this workspace. They are kept: publish refuses the ones that can't send (a sender, template, segment, topic or number) until they're fixed, and a new contact-field key is only a warning. Codes: sender_not_an_address (publish refuses it), sender_domain_not_found (publish refuses it), sender_domain_unverified (publish refuses it), resource_not_found (publish refuses it), sms_sender_inactive (publish refuses it), contact_field_not_found (a warning). Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body4 fields
FieldTypeDescription
namestring—
descriptionstring | null—
definitionobject—
policyobject—
Response · 200 fields20 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
200401403404409422

Delete an automation

DELETE/api/v1/automations/{id}

DELETE /automations/{id}
curl -X DELETE 'https://www.unitpost.com/api/v1/automations/atm_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'

Deletes the automation for good: it can't be undone, and it is gone from every list and read (its run history ages out as usual). To switch one off and keep it restorable, archive it instead. An archived automation is deleted with whatever it still has going; any other is refused while runs are in progress: archive it (which cancels them) or cancel them first (POST /automations/{id}/runs/cancel). Pausing holds runs, it doesn't finish them. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
204401403404409

Archive an automation

POST/api/v1/automations/{id}/archive

POST /automations/{id}/archive
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/archive' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ],
  "canceled_runs": 0,
  "backfill_stopped": false
}

Switches the automation off at once and keeps it restorable: nothing new starts, runs in progress are canceled (nothing more is sent to them; canceled_runs counts them), a running backfill stops (backfill_stopped), and it becomes read-only (edits, publish and resume answer 409 with error.details[].code automation_archived). It is deleted for good at delete_after (archive time plus the retention period, 30 days by default) unless unarchived first. Archiving an archived automation changes nothing. Refused while Unitpost support has paused it. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields22 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
canceled_runsrequiredintegerRuns in progress this archive canceled.
backfill_stoppedrequiredbooleanA running backfill was stopped.
200401403404409422

Unarchive an automation

POST/api/v1/automations/{id}/unarchive

POST /automations/{id}/unarchive
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/unarchive' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ]
}

Clears the archive and its delete_after. It comes back switched off and never sends by itself: paused when it was ever published (resume it to send again), draft otherwise (publish it). Resume of a restored automation first re-checks every template, segment, topic, sender and endpoint it uses, and any billing, block, throttle or paused-stream pause it had when archived, and answers 409 while one holds. Runs the archive canceled stay canceled. Needs only automations:write, since it starts nothing. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields20 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
200401403404409422

Validate an automation draft

POST/api/v1/automations/{id}/validate

POST /automations/{id}/validate
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/validate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{}'
Response · 200
{
  "object": "automation_validation",
  "ok": false,
  "errors": [
    {
      "code": "string",
      "message": "string",
      "node_id": "node_123",
      "edge_id": "edge_123",
      "path": [
        "string"
      ],
      "handle": "string"
    }
  ],
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "node_id": "node_123",
      "edge_id": "edge_123",
      "path": [
        "string"
      ],
      "handle": "string"
    }
  ],
  "dependencies": [
    {
      "resource_type": "string",
      "resource_id": "resource_123",
      "node_ids": [
        "string"
      ]
    }
  ],
  "readiness": {
    "ready": false,
    "summary": "string",
    "items": [
      {
        "code": "graph_error",
        "severity": "blocker",
        "owner": "user",
        "node_id": "node_123",
        "warning_code": "string",
        "message": "string",
        "fix": "string"
      }
    ],
    "verified": [
      "string"
    ],
    "journey": "string",
    "testing": [
      "string"
    ]
  }
}

Dry-run check of the draft: structure (block kinds, config, wiring, cycles, data paths) and dependency health (templates published, sender domains verified). ok: true means publish would succeed now, and ok is false exactly when errors isn't empty. Errors carry machine codes, node ids, and config paths so an agent can self-repair; warnings are advisory (readiness repeats them as heads_up items). A missing or not-yet-ready template, sender, segment or other reference is an error, under the code publish's 422 uses for it (dependency_missing, dependency_unhealthy, dependency_wrong_type, condition_ref_missing). Send a definition and/or policy to check a proposal instead of the stored draft: nothing is saved. A proposal is authoring, so it also needs automations:write. errors[].code and warnings[].code are one of unknown_kind, invalid_config, trigger_not_trigger, node_kind_is_trigger, duplicate_node_id, duplicate_edge_id, edge_unknown_from, edge_unknown_to, edge_unknown_handle, edge_duplicate_handle, edge_into_trigger, missing_handle_edge, orphan_node, cycle, trigger_disconnected, dependency_unavailable, path_unknown_scope, path_unknown_step, path_scope_unavailable, sms_quiet_hours, sms_variables_unmapped, email_variables_unmapped, sms_trigger_creates_contacts, sms_trigger_marketing_reply, wait_until_past, wait_until_contact_timezone, wait_too_long, path_outlives_run, run_lifetime_too_long, path_over_action_limit, webhook_secret_regenerate, event_data_secret, condition_ref_missing, wait_until_not_a_date, wait_until_field_unknown, template_type_mismatch, marketing_template_fixed_recipient, topic_needs_marketing_template (and the reference codes above); each issue carries node_id, edge_id, path (the config field) and handle where they apply. readiness is the pre-publish checklist in plain words: items[] with severity (blocker, needs_input: it can go live but nothing happens until someone provides something, such as the event their backend hasn't sent yet or a number to send texts from, heads_up) and owner (user, developer, agent), plus journey (the graph in words with timings) and testing. Publish when ok and readiness.ready are both true. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body2 fields
FieldTypeDescription
definitionobjectA proposed graph (`{ schemaVersion: 1, trigger, nodes, edges }`) to check instead of the stored draft. Nothing is saved.
policyobjectProposed settings to check with it, read as PATCH would store them (an omitted `reEntry` takes the trigger's default). Defaults to the stored policy.
Response · 200 fields6 fields
FieldTypeDescription
objectrequiredstring—
okrequiredbooleantrue when publish would succeed right now; false exactly when `errors` isn't empty.
errorsrequiredobject[]What refuses a publish, each with its `node_id` and `path`: graph errors, and a template, sender, segment or other reference that is missing or not ready yet.
warningsrequiredobject[]Things that don't block a publish; readiness repeats them as `heads_up` items.
dependenciesrequiredobject[]—
readinessrequiredobject | null—
200400401403404409422

Preview a publish

GET/api/v1/automations/{id}/publish

GET /automations/{id}/publish
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/publish' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_publish_preview",
  "automation_id": "automation_123",
  "mid_journey": 0,
  "held": 0,
  "stale": 0,
  "removed_blocks": [
    {
      "node_id": "node_123",
      "title": "string",
      "count": 1,
      "next_node_id": "next_node_123",
      "next_title": "string"
    }
  ],
  "backfill": {
    "available": false,
    "source": {
      "type": "segment",
      "id": "id_123",
      "name": "Example"
    },
    "count": 1,
    "count_partial": false,
    "skipped": {
      "unsubscribed": 0,
      "no_consent": 0,
      "already_through": 0,
      "filter": 0
    },
    "max": 0,
    "per_minute": 0,
    "runs_left": 0,
    "cost_cents": 0,
    "room": 0,
    "job": {
      "id": "id_123",
      "status": "queued",
      "total": 1,
      "processed": 0,
      "started": 0,
      "not_started": {},
      "error": "string"
    },
    "refusal": {
      "code": "string",
      "message": "string"
    }
  }
}

What publishing the current draft would do to the people mid-journey: how many there are (they move to the new version at the block they're on), how many a pause holds and how many of those waited more than 7 days, and, for each block the draft removes, how many people are on it and where move_to_next would take them. When removed_blocks lists anyone, pass removed_blocks to Publish (it answers 409 without it). backfill (a segment or topic trigger): the latest backfill job with what it did, and with ?backfill=true who a backfill would start now (count), who it skips and why, runs left, the cost past the included runs, and any refusal. Nothing changes. Requires the automations:read capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
backfillboolean · queryAlso count who a backfill would start (`backfill.count`, `skipped`, cost).
Response · 200 fields7 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
mid_journeyrequiredintegerLive runs (active and waiting); they move to the new version at their block.
heldrequiredintegerOf those, frozen at a step by a pause. A run still on a wait timer isn't counted until its wait ends; `mid_journey` counts every run in progress, which is what unpublishing a paused automation ends by default.
stalerequiredintegerHeld more than 7 days: a publish over the pause doesn't send them unless `send_stale`.
removed_blocksrequiredobject[]Blocks the draft removes that people are on.
backfillrequiredobject | nullWhat `backfill: true` on publish would start, or why it can't (W14).
200401403404

Publish an automation

POST/api/v1/automations/{id}/publish

POST /automations/{id}/publish
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/publish' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "changelog": "First version"
  }'
Response · 200
{
  "object": "automation_publish",
  "automation_id": "automation_123",
  "version": 0,
  "status": "active",
  "runs": {
    "moved": 0,
    "moved_to_next": 0,
    "at_removed_blocks": 0,
    "ended": 0,
    "held": 0,
    "expired": 0,
    "pending": 0
  },
  "backfill": {
    "status": "started",
    "count": 1,
    "job": {
      "id": "id_123",
      "status": "queued",
      "total": 1,
      "processed": 0,
      "started": 0,
      "not_started": {},
      "error": "string"
    },
    "message": "string"
  }
}

Go live: snapshots the draft (graph + policy) into an immutable version and starts enrolling on the trigger. Everyone mid-journey moves to the new version at the block they're on (a wait already in progress keeps its end time). People on a block the new version removes move to the next block or end their run, as removed_blocks says; when anyone is on a removed block and removed_blocks is missing, the publish answers 409 listing them (read GET on this path first). Publishing a paused automation also continues the runs the pause held; a held message older than 7 days is not sent unless send_stale is true. runs in the response counts what happened. Send an Idempotency-Key to make retries return the same version. An automation whose trigger is a received email also needs emails:read: each run receives the email's text, which its blocks can pass on (403 insufficient_scope otherwise). A Call webhook block posts each run's contact email and trigger event to an outside URL, so publishing one also needs contacts:read and the trigger's own read capability (emails:read for any email trigger, segments:read, topics:read, …). An automation with an SMS step needs a plan that includes SMS (403 limit_reached with feature_not_in_plan on smsChannel otherwise). Requires the automations:publish capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
Idempotency-Keystring · headerAny unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
Request body4 fields
FieldTypeDescription
changelogstring—
removed_blocksenummove_to_next | endRuns on a block this version removes: move them to the next block (when it had one path) or end their run (default).
send_stalebooleanPublishing over a pause: also send held messages older than 7 days (default false).
backfill_countintegerA segment or topic trigger only: also start it for the people already in it, at most this many: the `backfill.count` from `GET …/publish?backfill=true` that the person confirmed. More would start now = 422 `backfill_count_changed` and nothing goes live; it can't run = 422/409 with `details[].code` `backfill_*`. Runs as a job: follow it with GET /jobs/{id}.
Response · 200 fields6 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
versionrequiredinteger—
statusrequiredstring—
runsrequiredobject—
backfillobjectPresent when `backfill` was asked.
200401403404409422

Pause an automation

POST/api/v1/automations/{id}/pause

POST /automations/{id}/pause
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/pause' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ]
}

Stops new enrollments AND freezes in-flight runs where they are. Resume (or publish) continues them; a held message older than 7 days is not sent then (the run ends stale_hold) unless send_stale is true. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields20 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
200401403404409

Resume an automation

POST/api/v1/automations/{id}/resume

POST /automations/{id}/resume
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/resume' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "send_stale": false
  }'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ],
  "runs": {
    "held": 0,
    "expired": 0
  }
}

Back to live: enrollment restarts and every held run continues where it stopped. A held message older than 7 days is not sent (the run ends stale_hold) unless send_stale is true; the response's runs says how many continued and expired. Refused while the pause's cause still holds: a dependency still missing or not ready (a template deleted or no longer published, no SMS number that can send: fix it and resume, or point the block elsewhere and publish), or the cause of a billing, blocked, throttled or sending_paused pause (the message says why and when it resumes on its own). Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body1 field
FieldTypeDescription
send_stalebooleanAlso send held messages older than 7 days (default false: those runs end `stale_hold`).
Response · 200 fields21 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
runsrequiredobject—
200401403404409422

Unpublish an automation

POST/api/v1/automations/{id}/unpublish

POST /automations/{id}/unpublish
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/unpublish' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "held_runs": "end"
  }'
Response · 200
{
  "object": "automation",
  "id": "id_123",
  "name": "Example",
  "description": "string",
  "status": "draft",
  "pause_reason": "user",
  "published_version": 0,
  "has_draft_changes": false,
  "trigger": {
    "kind": "string",
    "config": {}
  },
  "active_runs": 0,
  "total_runs": 1,
  "failed_runs_30d": 0,
  "last_run_at": "2026-01-01T00:00:00.000Z",
  "archived_at": "2026-01-01T00:00:00.000Z",
  "delete_after": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "heads_up": [
    {
      "code": "sender_not_an_address",
      "node_id": "node_123",
      "field": "string",
      "resource_type": "template",
      "value": "string",
      "message": "string"
    }
  ],
  "warnings": [
    "string"
  ],
  "generated_secrets": [
    {
      "node_id": "node_123",
      "secret": "string"
    }
  ],
  "runs": {
    "ended": 0,
    "released": 0,
    "expired": 0
  }
}

Take it off live without deleting: enrollment stops, versions and history are kept. On a live automation, runs in progress finish on their version. On a paused one, the runs the pause holds END by default (held_runs: "end"), so nothing more is sent to those people; held_runs: "release" lets them finish instead, and is refused (409) while the pause's cause still holds, as Resume is. runs in the response counts what happened. A staff pause can't be unpublished. Publish again to relaunch. Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body1 field
FieldTypeDescription
held_runsenumend | releaseWhat happens to the runs a pause holds, when the automation is paused: `end` (default) ends them, so nothing more is sent to those people; `release` lets them finish on their version, refused (409) while the pause's cause still holds, as Resume is. Ignored on a live automation: its runs in progress finish.
Response · 200 fields21 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
descriptionrequiredstring | null—
statusrequiredenumdraft | active | paused | archived—
pause_reasonrequiredenum | null—
published_versionrequiredinteger | null—
has_draft_changesrequiredboolean—
triggerrequiredobject | null—
active_runsrequiredinteger—
total_runsrequiredinteger—
failed_runs_30drequiredinteger—
last_run_atrequiredstring | null—
archived_atrequiredstring | nullWhen it was archived; null unless `status` is `"archived"`.
delete_afterrequiredstring | nullWhen an archived automation is deleted for good unless it is unarchived first (archive time plus the retention period, 30 days by default); null unless `status` is `"archived"`.
created_atrequiredstring—
updated_atrequiredstring—
heads_upobject[]On create and update: values in the saved draft that couldn't be verified here (an invented template id, a sender on a domain that isn't verified). They're kept; publish refuses them until fixed.
warningsstring[]Update only: what this edit changed that you didn't write, in plain words. Today one case: with `maxConcurrentRunsPerSubject` left out, a custom-event journey's runs per person at once follows its graph, so an edit that adds or removes a match on the event's own data (`{{event.data.<key>}}` in a Wait for event, the goal or the exit rule, or a Wait until on an event date), or a policy sent without the field, moves it (1 or 10). The sentence names the old and new value, why, and how to keep the old one. Absent when nothing did. Tell the user.
generated_secretsobject[]On create and update, when this write generated a Call webhook block's signing secret (a new block whose `secret` was left out, or `"generate"`): the secret, this once. Reads only ever show a placeholder.
runsrequiredobject—
200401403404409422

List runs

GET/api/v1/automations/{id}/runs

GET /automations/{id}/runs
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/runs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "automation_run",
      "id": "id_123",
      "automation_id": "automation_123",
      "status": "active",
      "exit_reason": "string",
      "subject": {
        "type": "string",
        "contact_id": "contact_123",
        "label": "string"
      },
      "version": 0,
      "step_count": 1,
      "held": false,
      "at_block_id": "at_block_123",
      "backfill_job_id": "backfill_job_123",
      "started_at": "2026-01-01T00:00:00.000Z",
      "completed_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

The execution ledger for one automation, newest first. Filter with status (a run status, or the groups live / problems), block (the runs at a block now, or that failed at it; each run's at_block_id) and backfill (the runs one backfill started). Pages like every list: while has_more, pass the last run's id as after for the next (older) page; before with the first run's id goes back. Runs that started on the same instant are never skipped or repeated. Requires the automations:read capability.

Parameters8 fields
FieldTypeDescription
idrequiredstring · path—
statusstring · queryactive | waiting | completed | exited | goal_met | failed | canceled | live | problems
blockstring · queryA block id: live runs waiting at or about to run that block, and runs that failed at it.
contact_idstring · queryOnly this contact's runs (`con_…`).
backfillstring · queryOnly the runs one backfill started (its job id, `job_…`).
limitinteger · queryMax rows to return (default 20, max 100).
afterstring · queryNext page: the last run's `id` (`run_…`) from the previous page, while `has_more` is true.
beforestring · queryPrevious page: the first run's `id` (`run_…`). Not with `after`. An ISO 8601 time is also accepted: the runs started before it.
Response · 200 fields13 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
automation_idrequiredstring—
statusrequiredenumactive | waiting | completed | exited | goal_met | failed | canceled—
exit_reasonrequiredstring | nullWhy the run stopped; null while live. `finished` (it reached the end, or an Exit block, which may give its own reason), `exit_condition`, `goal`, `restarted`, `max_steps`, `ttl`, `cancel`, `automation_archived`, `block_removed`, `stale_hold`, `error:<node_id>`, … A run that reached an Exit block before 2026-12-01 reads `exit_node` (status `exited`).
subjectrequiredobject—
versionrequiredinteger | null—
step_countrequiredinteger—
heldrequiredbooleanA pause froze the run at its next step; Resume (or a publish) continues it. A run still on a wait timer of a paused automation reads false until its wait ends, then it is held there. Unpublishing a paused automation ends every run in progress, held or not, unless `held_runs: "release"`.
at_block_idrequiredstring | null—
backfill_job_idrequiredstring | nullThe backfill that started it (`job_…`; publish's `backfill_count`), or null for a run its trigger or a manual enroll started. Filter with `?backfill=`, cancel one backfill's runs with POST …/runs/cancel `backfill`.
started_atrequiredstring—
completed_atrequiredstring | null—
200401403404422

Enroll a contact (manual trigger)

POST/api/v1/automations/{id}/runs

POST /automations/{id}/runs
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sam@acme.com",
    "idempotency_key": "enroll-sam-2026-11-02"
  }'
Response · 202
{
  "object": "automation_enrollment",
  "accepted": true,
  "automation_id": "automation_123",
  "contact_id": "contact_123",
  "event_id": "event_123"
}

Start one run for one contact. Only for an automation published with the manual-enrollment trigger — anything else is driven by the event it listens for, and is refused here. Send exactly one of contact_id or email; add an idempotency_key so a retry can't start a second run. Returns **202**: enrollment is asynchronous, and the automation's own policy (re-entry rules, per-contact concurrency, active-run ceiling) may still decline it, as does no_consent: every message the journey could send would be skipped for this contact by consent, so no run starts and nothing is billed (guard_trips.no_consent in the stats). Preview an enrollment says which beforehand. Poll GET on this same path to see the run. Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body3 fields
FieldTypeDescription
contact_idstringThe contact to enroll (`con_…`).
emailstringOr the contact to enroll, by email address.
idempotency_keystringRetries with the same key enroll once.
Response · 202 fields5 fields
FieldTypeDescription
objectrequiredstring—
acceptedrequiredboolean—
automation_idrequiredstring—
contact_idrequiredstring—
event_idrequiredstring—
202401403404409422502

Preview an enrollment

POST/api/v1/automations/{id}/runs/preview

POST /automations/{id}/runs/preview
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs/preview' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sam@acme.com"
  }'
Response · 200
{
  "object": "automation_enrollment_preview",
  "automation_id": "automation_123",
  "would_enroll": false,
  "blocked_by": "automation_live",
  "contact": {
    "id": "id_123",
    "email": "customer@example.com"
  },
  "checks": [
    {
      "code": "automation_live",
      "passed": false,
      "message": "string"
    }
  ]
}

Would enrolling this contact (contact_id or email, as the enroll takes) start a run now, and if not, which check stops it: the automation isn't live, its trigger isn't manual enrollment, no such contact, a run already in progress, re-entry, every message would be skipped for them by consent (no_consent), the hourly run rate, or the automation's or the workspace's live-run ceiling. Nothing is written. Read it before enrolling: the enroll is accepted asynchronously and may still be declined. Also needs contacts:read. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body2 fields
FieldTypeDescription
contact_idstringThe contact (`con_…`).
emailstringOr the contact's email address.
Response · 200 fields6 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
would_enrollrequiredbooleanEnrolling this contact now would start a run. Advisory: the engine checks again when it enrolls.
blocked_byrequiredenum | nullThe first check that stops it, or null.
contactrequiredobject | null—
checksrequiredobject[]In enrollment's order: `automation_live`, `manual_trigger`, `contact_found`, then (once those pass) the policy gates `run_in_progress`, `re_entry`, `no_consent` (every message it could send would be skipped for them by consent: no run, nothing billed), `run_rate`, `max_active_runs`, `workspace_live_runs`.
200401403404422

Retrieve a run

GET/api/v1/automations/runs/{run_id}

GET /automations/runs/{run_id}
curl -X GET 'https://www.unitpost.com/api/v1/automations/runs/run_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_run",
  "id": "id_123",
  "automation_id": "automation_123",
  "status": "active",
  "exit_reason": "string",
  "subject": {
    "type": "string",
    "contact_id": "contact_123",
    "label": "string"
  },
  "version": 0,
  "step_count": 1,
  "held": false,
  "at_block_id": "at_block_123",
  "backfill_job_id": "backfill_job_123",
  "started_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z",
  "automation": {
    "id": "id_123",
    "name": "Example",
    "status": "draft",
    "pause_reason": "user"
  },
  "trigger_node_id": "trigger_node_123",
  "current_node_id": "current_node_123",
  "failed_node_id": "failed_node_123",
  "waiting": {
    "node_id": "node_123",
    "until": "string",
    "event_type": "string",
    "timeout_at": "2026-01-01T00:00:00.000Z"
  },
  "steps_executed": 0,
  "action_steps_executed": 0,
  "billed": false,
  "trigger": {
    "id": "id_123",
    "type": "string",
    "source": "string",
    "created_at": "2026-01-01T00:00:00.000Z",
    "data": {},
    "data_hidden": false,
    "contact_data_hidden": false
  },
  "definition": {
    "schemaVersion": 1,
    "trigger": {
      "id": "id_123",
      "kind": "string",
      "label": "string",
      "config": {}
    },
    "nodes": [
      {
        "id": "id_123",
        "kind": "string",
        "label": "string",
        "config": {}
      }
    ],
    "edges": [
      {
        "id": "id_123",
        "from": "you@yourdomain.com",
        "fromHandle": "string",
        "to": "customer@example.com"
      }
    ],
    "layout": {}
  },
  "steps": [
    {
      "id": "id_123",
      "node_id": "node_123",
      "node_kind": "string",
      "attempt": 0,
      "status": "queued",
      "output": "string",
      "error": "string",
      "started_at": "2026-01-01T00:00:00.000Z",
      "completed_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

One run with its step timeline — every executed block with status, output (branch taken, email id, skip reason; ids prefixed, so a send's message_id is the email_… or sms_… id Retrieve an email takes), error, and timing — plus where a live run is now (current_node_id, waiting), the block a failed run stopped at, the event that started it (trigger) and the graph of the version it runs on (definition). Answers "why didn't this contact get the email?". Another resource's content (an inbound email's text, the contact's email) needs that resource's read scope too. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
run_idrequiredstring · path—
Response · 200 fields24 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
automation_idrequiredstring—
statusrequiredenumactive | waiting | completed | exited | goal_met | failed | canceled—
exit_reasonrequiredstring | nullWhy the run stopped; null while live. `finished` (it reached the end, or an Exit block, which may give its own reason), `exit_condition`, `goal`, `restarted`, `max_steps`, `ttl`, `cancel`, `automation_archived`, `block_removed`, `stale_hold`, `error:<node_id>`, … A run that reached an Exit block before 2026-12-01 reads `exit_node` (status `exited`).
subjectrequiredobject—
versionrequiredinteger | null—
step_countrequiredinteger—
heldrequiredbooleanA pause froze the run at its next step; Resume (or a publish) continues it. A run still on a wait timer of a paused automation reads false until its wait ends, then it is held there. Unpublishing a paused automation ends every run in progress, held or not, unless `held_runs: "release"`.
at_block_idrequiredstring | null—
backfill_job_idrequiredstring | nullThe backfill that started it (`job_…`; publish's `backfill_count`), or null for a run its trigger or a manual enroll started. Filter with `?backfill=`, cancel one backfill's runs with POST …/runs/cancel `backfill`.
started_atrequiredstring—
completed_atrequiredstring | null—
automationrequiredobjectThe automation this run belongs to, as it is now.
trigger_node_idrequiredstring—
current_node_idrequiredstring | nullA live run's block now: the one it waits on, else the last one it ran. Null once the run ended.
failed_node_idrequiredstring | nullThe block a failed run stopped at.
waitingrequiredobject | nullWhere a live run is parked, and until when or for what. Null when it isn't waiting or has ended.
steps_executedrequiredinteger—
action_steps_executedrequiredintegerSteps that count toward the run's step budget (sends, updates, webhooks).
billedrequiredbooleanThe run was billed (its first action step ran).
triggerrequiredobject | nullThe event that started the run, frozen at enrollment.
definitionrequiredobject | nullThe graph of the version this run runs on (name blocks from it, not from the current draft).
stepsrequiredobject[]—
200401403404

Cancel a run

POST/api/v1/automations/runs/{run_id}/cancel

POST /automations/runs/{run_id}/cancel
curl -X POST 'https://www.unitpost.com/api/v1/automations/runs/run_123/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_run",
  "id": "id_123",
  "automation_id": "automation_123",
  "status": "active",
  "exit_reason": "string",
  "subject": {
    "type": "string",
    "contact_id": "contact_123",
    "label": "string"
  },
  "version": 0,
  "step_count": 1,
  "held": false,
  "at_block_id": "at_block_123",
  "backfill_job_id": "backfill_job_123",
  "started_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}

Stop one live run: its timers are cancelled and no further step executes. Terminal runs return 409. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
run_idrequiredstring · path—
Response · 200 fields13 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
automation_idrequiredstring—
statusrequiredenumactive | waiting | completed | exited | goal_met | failed | canceled—
exit_reasonrequiredstring | nullWhy the run stopped; null while live. `finished` (it reached the end, or an Exit block, which may give its own reason), `exit_condition`, `goal`, `restarted`, `max_steps`, `ttl`, `cancel`, `automation_archived`, `block_removed`, `stale_hold`, `error:<node_id>`, … A run that reached an Exit block before 2026-12-01 reads `exit_node` (status `exited`).
subjectrequiredobject—
versionrequiredinteger | null—
step_countrequiredinteger—
heldrequiredbooleanA pause froze the run at its next step; Resume (or a publish) continues it. A run still on a wait timer of a paused automation reads false until its wait ends, then it is held there. Unpublishing a paused automation ends every run in progress, held or not, unless `held_runs: "release"`.
at_block_idrequiredstring | null—
backfill_job_idrequiredstring | nullThe backfill that started it (`job_…`; publish's `backfill_count`), or null for a run its trigger or a manual enroll started. Filter with `?backfill=`, cancel one backfill's runs with POST …/runs/cancel `backfill`.
started_atrequiredstring—
completed_atrequiredstring | null—
200401403404409

Skip a run's wait

POST/api/v1/automations/runs/{run_id}/skip-wait

POST /automations/runs/{run_id}/skip-wait
curl -X POST 'https://www.unitpost.com/api/v1/automations/runs/run_123/skip-wait' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_run",
  "id": "id_123",
  "status": "waiting",
  "node_id": "node_123",
  "path": "next",
  "resumes_at": "2026-01-01T00:00:00.000Z"
}

End one waiting run's wait now, as the run inspector's Skip wait does: a Wait continues with its next block, a Wait for event takes its Timeout path, on the engine's next timer tick. A run that isn't waiting on a wait block, a paused automation, or a wait already ending is a 409. Takes no body. Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
run_idrequiredstring · path—
Response · 200 fields6 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
statusrequiredstringStill waiting until the engine's next timer tick picks it up.
node_idrequiredstring—
pathrequiredenumnext | timeout`next` after a Wait; `timeout` after a Wait for event.
resumes_atrequiredstring—
200400401403404409422

Retry a failed run

POST/api/v1/automations/runs/{run_id}/retry

POST /automations/runs/{run_id}/retry
curl -X POST 'https://www.unitpost.com/api/v1/automations/runs/run_123/retry' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_run",
  "id": "id_123",
  "status": "active",
  "node_id": "node_123",
  "version": 0
}

Continue one failed run from the block that failed, in the same run, on the live version (as the Runs tab's Retry). Blocks that already ran are not repeated, and a message the failed attempt actually sent is recorded, never sent again. 409 when the run isn't failed, didn't fail at a block, the automation isn't live, the run's time limit passed, or the person is mid-journey in another run. Takes no body. Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
run_idrequiredstring · path—
Response · 200 fields5 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
statusrequiredstring—
node_idrequiredstringThe block the run continues from.
versionrequiredintegerThe live version it continues on.
200400401403404409422

Retry failed runs

POST/api/v1/automations/{id}/runs/retry

POST /automations/{id}/runs/retry
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs/retry' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "since": "2026-11-01T00:00:00Z",
    "limit": 50
  }'
Response · 200
{
  "object": "automation_runs_retry",
  "retried": 0,
  "skipped": {},
  "remaining": 0,
  "next_cursor": "string"
}

Retry every run of the automation that failed at or after since, newest first, up to 200 per call. Each run continues as Retry a failed run does. Runs that can't continue are counted in skipped by reason and passed over; remaining counts the failed runs the call didn't reach, and passing next_cursor back as cursor continues after them. Repeating the call retries nothing new. Requires the automations:publish capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body3 fields
FieldTypeDescription
sincerequiredstringRetry runs that failed at or after this time (ISO 8601).
limitintegerMost runs to retry in this call (default and max 200).
cursorstring`next_cursor` from the previous call: continue past the runs it looked at.
Response · 200 fields5 fields
FieldTypeDescription
objectrequiredstring—
retriedrequiredinteger—
skippedrequiredobjectRuns that can't continue, by reason: `in_progress` (the person, or a contact-less automation, has a run in progress; retry once it ends), `already_ran` (the run is past that block), `block_removed` (the live version removed the block and nothing follows), `run_expired` (past its time limit), `not_live`, `not_failed`, `not_retryable`.
remainingrequiredintegerFailed runs in range this call didn't reach. Call again with `next_cursor` to retry them.
next_cursorrequiredstring | nullPass as `cursor` to continue; null when every failed run in range was looked at.
200401403404409422

Cancel live runs

POST/api/v1/automations/{id}/runs/cancel

POST /automations/{id}/runs/cancel
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "contact_id": "con_123"
  }'
Response · 200
{
  "object": "automation_runs_cancel",
  "canceled": 0,
  "backfill": {
    "job_id": "job_123",
    "stopped": false
  }
}

Stop the automation's live runs in one call: all of them (status: live, the default) or only active or waiting ones. Their timers are cancelled and nothing more executes for them. Cancel them before deleting an automation that still has runs in progress. With contact_id, only that contact's runs stop (naming a contact also needs contacts:read); to stop a contact in every automation, use Cancel a contact's automation runs. Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body3 fields
FieldTypeDescription
statusenumlive | active | waitingWhich live runs to cancel: all (`live`, default), only `active` or only `waiting`.
backfillstringOnly one backfill's runs (`job_…`, or `latest`): it stops that backfill (nobody else starts) and cancels the live runs it started; runs the trigger started are left alone.
contact_idstringOnly this contact's runs (`con_…`; also needs `contacts:read`): stop one person in this automation and leave everyone else's runs alone. To stop them in every automation, use POST /contacts/{id}/automation-runs/cancel.
Response · 200 fields3 fields
FieldTypeDescription
objectrequiredstring—
canceledrequiredinteger—
backfillobject—
200400401403404422

Dry-run an automation

POST/api/v1/automations/{id}/simulate

POST /automations/{id}/simulate
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/simulate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sam@acme.com",
    "event_data": {
      "cart_url": "https://shop.acme.com/cart/123"
    }
  }'
Response · 200
{
  "object": "automation_simulation",
  "automation_id": "automation_123",
  "version": "draft",
  "subject": "Welcome to Acme",
  "sent": false,
  "enters": false,
  "reason": "string",
  "paths": [
    {
      "assumptions": [
        "string"
      ],
      "steps": [
        {
          "node_id": "node_123",
          "title": "string",
          "at": "string",
          "outcome": "would_send",
          "detail": "string"
        }
      ],
      "sends": 0,
      "skips": 0
    }
  ],
  "summary": "string",
  "not_simulated": "string"
}

Walk the draft (or version: live) for one contact and say which messages they'd get, when, and which branches they'd take, as the builder's test does. Pass a real contact (email or contact_id, which also needs contacts:read) or a made-up one (contact fields), and event_data for a custom event's payload. Nothing is sent and nothing changes. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body7 fields
FieldTypeDescription
emailstringA real contact by email (also needs `contacts:read`).
contact_idstringA real contact by id (also needs `contacts:read`).
contactobjectOr a made-up contact: its fields (`first_name`, `plan`, …).
phonestringA made-up contact's phone number.
sms_consentbooleanA made-up contact's SMS marketing consent.
event_dataobjectThe trigger event's payload, read as event.data.*.
versionenumdraft | live`draft` (default) or the `live` version.
Response · 200 fields10 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
versionrequiredenumdraft | live—
subjectrequiredstringWho was walked: the contact, or "a test contact".
sentrequiredbooleanA dry run never sends.
entersrequiredboolean—
reasonrequiredstring | nullWhy it wouldn't enter, when `enters` is false.
pathsrequiredobject[]One path per wait-for-event outcome (the event arrives / times out).
summaryrequiredstring—
not_simulatedrequiredstring—
200400401403404409422

Retrieve an automation's stats

GET/api/v1/automations/{id}/stats

GET /automations/{id}/stats
curl -X GET 'https://www.unitpost.com/api/v1/automations/atm_123/stats' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "automation_stats",
  "automation_id": "automation_123",
  "window": {
    "days": 0,
    "since": "string"
  },
  "retention_days": 0,
  "runs": {
    "window": {
      "entered": 0,
      "active": 0,
      "waiting": 0,
      "completed": 0,
      "goal_reached": 0,
      "exited": 0,
      "failed": 0,
      "canceled": 0
    },
    "lifetime": {
      "entered": 0,
      "active": 0,
      "waiting": 0,
      "completed": 0,
      "goal_reached": 0,
      "exited": 0,
      "failed": 0,
      "canceled": 0
    },
    "held_marketing": 0
  },
  "goal": {
    "set": false,
    "window_rate": 0,
    "lifetime_rate": 0
  },
  "version": {
    "version": 0,
    "published_at": "2026-01-01T00:00:00.000Z"
  },
  "trigger": {
    "id": "id_123",
    "kind": "string",
    "title": "string"
  },
  "blocks": [
    {
      "id": "id_123",
      "kind": "string",
      "title": "string",
      "entered": 0,
      "succeeded": 0,
      "failed": 0,
      "skipped": 0,
      "skip_reasons": {},
      "branches": {},
      "waiting_now": 0,
      "active_now": 0,
      "failed_in_window": 0,
      "failing": false,
      "duration": {
        "measures": "execution",
        "avg_ms": 0,
        "p50_ms": 0,
        "p95_ms": 0
      }
    }
  ],
  "guard_trips": {},
  "failed_outside_blocks": 0
}

How the automation is running, the numbers the builder shows: runs by status over a window (the runs that started in the last days days) and over its lifetime (runs retention has deleted included), the goal rate, and for each block of the live version the runs that entered, succeeded, failed and were skipped (by reason), the runs waiting there now, the runs that failed there in the window, and how long it takes (a wait: how long runs waited). While the workspace's marketing email is paused, runs.held_marketing counts the runs waiting at a marketing email: they send once it is resumed (after 7 days they end unsent), and the automation keeps running. Block counts start over when you publish a new version. Counts only. To see the runs themselves, filter List runs by status or block. Requires the automations:read capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
daysinteger · queryThe window in days, 1–90 (default 7). Never reaches past run retention (30 days on Free). A block is `failing` when a run failed at it in this window.
Response · 200 fields11 fields
FieldTypeDescription
objectrequiredstring—
automation_idrequiredstring—
windowrequiredobject—
retention_daysrequiredintegerHow long finished runs are kept: 30 days on Free, 90 otherwise.
runsrequiredobject—
goalrequiredobject—
versionrequiredobject | nullThe live version the block counts belong to. Republishing starts them over.
triggerrequiredobject | null—
blocksrequiredobject[]—
guard_tripsrequiredobjectTimes a limit held the live version back, by rule: `re_entry`, `run_in_progress`, `max_active_runs`, `frequency_capped`, `run_rate`, `loop_hop_budget`, `max_steps`, `ttl`, … (the "held back by limits" count). `unmatched_subject` counts custom events whose `email` isn't a contact and that were sent with `create_contact: false`, or whose `contact_id` matched nobody: no run started and no contact was made. `contact_limit` counts unknown emails at the plan's contact limit. An unknown email sent without `create_contact: false` becomes a contact and starts the run, so it isn't counted here. `no_consent` counts people who started no run because every message it could send them would be skipped by consent (unsubscribed, not subscribed to the email's topic, no SMS consent): nothing was billed.
failed_outside_blocksrequiredintegerRuns that failed outside any block (step limit, billing), counted like `failed_in_window` (by when they failed, since the window's start or the live version's publish); not part of `runs.window`, which counts runs by when they started.
200401403404422503

List a contact's automation runs

GET/api/v1/contacts/{id}/automation-runs

GET /contacts/{id}/automation-runs
curl -X GET 'https://www.unitpost.com/api/v1/contacts/con_123/automation-runs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "automation_run",
      "id": "id_123",
      "automation_id": "automation_123",
      "automation_name": "string",
      "contact_id": "contact_123",
      "status": "queued",
      "exit_reason": "string",
      "at_block": {
        "id": "id_123",
        "title": "string"
      },
      "held": false,
      "version": 0,
      "started_at": "2026-01-01T00:00:00.000Z",
      "completed_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

One contact's runs across every automation, as the contact page shows them: the runs in progress first (newest first, up to 20, has_more when there are more), then the latest 10 finished ones (finished runs are kept 30 days on Free, 90 otherwise). Each names its automation and the block it waits at, runs next or failed at. {id} is the contact's id or email. Open one with Retrieve a run. Also needs contacts:read. Requires the automations:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · pathThe contact's id (`con_…`) or email.
Response · 200 fields12 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
automation_idrequiredstring—
automation_namerequiredstring—
contact_idrequiredstring—
statusrequiredstringactive | waiting | completed | exited | goal_met | failed | canceled
exit_reasonrequiredstring | null—
at_blockrequiredobject | nullThe block the run waits at or runs next, or failed at.
heldrequiredbooleanA pause froze the run at its next step; Resume continues it. A run still on a wait timer of a paused automation reads false until its wait ends.
versionrequiredinteger | null—
started_atrequiredstring—
completed_atrequiredstring | null—
200401403404

Cancel a contact's automation runs

POST/api/v1/contacts/{id}/automation-runs/cancel

POST /contacts/{id}/automation-runs/cancel
curl -X POST 'https://www.unitpost.com/api/v1/contacts/con_123/automation-runs/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "automation_ids": [
      "atm_123"
    ]
  }'
Response · 200
{
  "object": "contact_automation_runs_cancel",
  "contact_id": "contact_123",
  "canceled": 0,
  "automations": [
    {
      "automation_id": "automation_123",
      "canceled": 0
    }
  ]
}

Stop one contact's live runs in every automation, or only in automation_ids: someone asked you to stop, got a refund, or opened a support case. Their timers are cancelled and nothing more is sent to them by those runs; the automations stay live for everyone else (a later trigger can start them again, so add an exit rule or update the contact when that must not happen). {id} is the contact's id or email. The runs it stops are the ones List a contact's automation runs shows in progress. Also needs contacts:read (it names a contact). Requires the automations:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · pathThe contact's id (`con_…`) or email.
Request body2 fields
FieldTypeDescription
automation_idsstring[]Only these automations (`atm_…`, up to 100). Leave it out to stop the contact's runs in every automation.
statusenumlive | active | waitingWhich live runs to cancel: all (`live`, default), only `active` or only `waiting`.
Response · 200 fields4 fields
FieldTypeDescription
objectrequiredstring—
contact_idrequiredstring—
canceledrequiredintegerRuns canceled, across every automation.
automationsrequiredobject[]Each automation it stopped runs in, most runs first. Empty when nothing was live.
200400401403404422

Events

Emit your own custom events (e.g. cart.updated) onto the Unitpost event bus from your backend. Subscribed webhook endpoints receive them, and they can trigger automations.

Emit a custom event

POST/api/v1/events

POST /events
curl -X POST 'https://www.unitpost.com/api/v1/events' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "order.completed",
    "email": "sam@acme.com",
    "data": {
      "order_id": "ord_981",
      "total": 42.5
    },
    "idempotency_key": "ord_981"
  }'
Response · 201
{
  "object": "event",
  "id": "id_123",
  "name": "Example",
  "source": "customer",
  "contact_id": "contact_123",
  "email": "customer@example.com",
  "status": "queued",
  "warnings": [
    "string"
  ]
}

Send a custom event from your backend onto the Unitpost event bus — e.g. cart.updated or order.completed. Event names are your own bare, lowercase dotted identifiers (reserved platform prefixes like email. or contact. are rejected); deliveries carry source: "customer" so they're always distinguishable from built-in platform events. Link the event to a contact with email and/or contact_id, and pass an idempotency_key to make retried requests emit exactly once. Webhook endpoints subscribed to the event name receive it (see Create a webhook endpoint), and it can trigger automations. New event names are registered to your workspace vocabulary automatically on first use. An event starts a run in every live automation whose custom-event trigger names it, resumes runs waiting for it, and can meet a goal. Each automation's policy decides who starts: one live run per person at a time by default (maxConcurrentRunsPerSubject; a journey that tells runs apart by the event's own data allows up to 10), its re-entry rule, and no_consent: no run starts for a person every message of the journey would skip for consent, and nothing is billed (guard_trips.no_consent in the stats). So it can send: emit a test event only when that is what you want. An email no contact has becomes a contact when a live automation that needs one starts from the event (subscribed, its address's consent source event, no topic choices, counted against the plan's contacts); create_contact: false opts out and the answer's warnings says so. At the contact limit nothing is made and no run starts. Requires the events:emit capability.

Request body6 fields
FieldTypeDescription
namerequiredstring—
dataobject—
emailstring—
contact_idstring—
idempotency_keystring—
create_contactboolean—
Response · 201 fields8 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
sourcerequiredstring—
contact_idrequiredstring | null—
emailrequiredstring | null—
statusrequiredstring—
warningsrequiredstring[]Said when `email` isn't a contact yet: with `create_contact` left out, a live automation that sends to or reads the contact makes it one (subscribed) when this event starts it; with `create_contact: false`, no contact is made and those automations start nothing. Empty otherwise.
201401403404422502

List event definitions

GET/api/v1/events/definitions

GET /events/definitions
curl -X GET 'https://www.unitpost.com/api/v1/events/definitions' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "event_definition",
      "name": "Example",
      "description": "string",
      "last_seen_at": "2026-01-01T00:00:00.000Z",
      "created_at": "2026-01-01T00:00:00.000Z",
      "payload_keys": [
        {
          "key": "string",
          "type": "string"
        }
      ],
      "payload_keys_truncated": false
    }
  ]
}

The custom events your backend has sent: each name, when it was last seen, and the top-level payload keys seen with it (read as event.data.<key>; keys and types only, never values). Build a custom-event trigger or an event.data condition from it instead of guessing. The whole vocabulary comes back in one page (at most 500 names), most recently seen first. Requires the automations:read capability.

Response · 200 fields7 fields
FieldTypeDescription
objectrequiredstring—
namerequiredstringThe event name, as sent to POST /events.
descriptionrequiredstring | null—
last_seen_atrequiredstring | nullWhen the backend last sent it.
created_atrequiredstringWhen it was first sent.
payload_keysrequiredobject[]Top-level `data` keys seen with it (read as `event.data.<key>`), alphabetical, at most 50, never values. `contact_id` and `email` are on every event and aren't listed; keys that look like ids (a payload keyed by SKU or user id) aren't recorded. Recorded since automations were enabled for the workspace's environment.
payload_keys_truncatedrequiredbooleanThe list stopped growing at 50: a payload brought more keys than it keeps.
200401403

Search docs and guides

Search the docs and product guides.