Automation events and webhooks

Send custom events from your backend, list the ones you've sent with their payload keys, and get signed webhooks when an automation changes.

Your backend tells Unitpost what happened with custom events. Each one can start automations, resume runs waiting for it, and meet a goal.

Send an event

  • Names are your own: lowercase, dot separated, up to 5 parts (cart.updated, order.completed). No custom. prefix.
  • Platform prefixes are reserved and refused: email., domain., contact., segment., topic., campaign., automation., workspace., message., sms., whatsapp., telegram., sender., push., voice., rcs., chat..
  • Link the event to a contact with email or contact_id. An email that isn't a contact yet becomes one when a live automation that needs a contact starts from the event (subscribed, no topics chosen, like POST /contacts, its consent source event; it counts against the plan's contacts); create_contact: false opts out, and then that journey starts no run for it (guard_trips.unmatched_subject). At the plan's contact limit no contact is made and no run starts (guard_trips.contact_limit). A journey that only emails a fixed address or calls a webhook (an ops alert) runs with no contact either way.
  • Keep secrets out of event data (tokens, one-time codes, passwords, verify or sign-in links): it is kept in the event log and each run's history and goes to every webhook subscribed to the event. Validate warns (event_data_secret).
  • Pass idempotency_key so a retried request emits once.
  • The first event with a new name registers it. GET /v1/events/definitions lists your names and the payload keys seen with them.
  • Sending events needs the events:emit capability. A Sending key created before automations launched doesn't have it (403 insufficient_scope says so): create a new Sending key. Webhook endpoints can subscribe to your event names too.
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"
  }'

Limits

  • A workspace can use 500 event names. A new name past that is refused (403 limit_reached) and names can't be deleted yet: reuse one, or contact support to remove names you no longer send. Keep ids and other changing values in data, never in the name.
  • A contact an event makes has its email address and nothing else: a template that says "Hi {{first_name}}" fails for them (readiness says event_contact_no_name) unless the block gives the name a fallback, used only for a contact without one (variables: { first_name: { path: "contact.first_name", fallback: "there" } }), or the name is saved on the contact first.
  • Each event is one request against the workspace's API request limit, which sends share (10 a second by default, with no batch call): a request over it is a 429 that recorded nothing, safe to send again after Retry-After.

A test event is real

An event starts a run in every live automation listening for it (one live run per person by default), and those can send. Emit one by hand only when that is what you want.

Events you've sent

GET /v1/events/definitions lists each event name your backend has sent, when it was last seen, and the payload keys seen with it (key names and types, never values). Build triggers and event.data conditions from it instead of guessing.

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

Automation webhooks

Subscribe a webhook endpoint to these automation events, or to automation.*: automation.paused, automation.resumed, automation.run.failed. A pause carries its pause_reason (see Automation runs and debugging). Each delivery is the usual signed envelope; data differs by type:

automation.paused

FieldTypeWhat it is
automation_idstringThe automation (atm_…).
namestringIts name when the event happened.
statusstringpaused.
pause_reasonstringWhy it paused: one of the pause reasons (user, dependency_broken, billing, …). New values can be added: treat one you don't know as paused for another reason.
Delivery body
{
  "type": "automation.paused",
  "source": "platform",
  "created_at": "2026-01-15T09:30:00.000Z",
  "event_id": "f6a1f1f6-6a86-4f8f-9d2e-1c2b3a4d5e6f",
  "workspace_id": "ws_2WworkspaceExmpl1",
  "data": {
    "automation_id": "atm_2WautomationExmpl",
    "name": "Welcome series",
    "status": "paused",
    "pause_reason": "dependency_broken"
  }
}

automation.resumed

FieldTypeWhat it is
automation_idstringThe automation (atm_…).
namestringIts name when the event happened.
statusstringactive.
pause_reasonnullAlways null on a resume.
Delivery body
{
  "type": "automation.resumed",
  "source": "platform",
  "created_at": "2026-01-15T09:30:00.000Z",
  "event_id": "f6a1f1f6-6a86-4f8f-9d2e-1c2b3a4d5e6f",
  "workspace_id": "ws_2WworkspaceExmpl1",
  "data": {
    "automation_id": "atm_2WautomationExmpl",
    "name": "Welcome series",
    "status": "active",
    "pause_reason": null
  }
}

automation.run.failed

FieldTypeWhat it is
automation_idstringThe automation (atm_…).
namestringIts name when the event happened.
run_idstringThe run (run_…). Read it with GET /v1/automations/runs/{id} for the step and its error, which the webhook never carries.
versionnumber | nullThe published version the run was on.
contact_idstring | nullThe contact (con_…), never an address; null for a run with no contact.
failed_blockobject | null{ id, kind, title } of the block it failed at; null when it failed outside a block (the step limit, billing, a broken version).
reasonstringWhy: block_failed, max_steps, billing_rejected, definition_invalid, unknown_block, other.
failed_atstringWhen the run failed (ISO 8601, UTC).
Delivery body
{
  "type": "automation.run.failed",
  "source": "platform",
  "created_at": "2026-01-15T09:30:00.000Z",
  "event_id": "f6a1f1f6-6a86-4f8f-9d2e-1c2b3a4d5e6f",
  "workspace_id": "ws_2WworkspaceExmpl1",
  "data": {
    "automation_id": "atm_2WautomationExmpl",
    "name": "Welcome series",
    "run_id": "run_2WrunExample00001",
    "version": 3,
    "contact_id": "con_2WcontactExmpl01",
    "failed_block": {
      "id": "send_welcome",
      "kind": "action.email.send",
      "title": "Send welcome email"
    },
    "reason": "block_failed",
    "failed_at": "2026-01-15T09:30:00.000Z"
  }
}

Webhook endpoints can also subscribe to your own event names, so one event can drive an automation and your other systems.

Search docs and guides

Search the docs and product guides.