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). Nocustom.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
emailorcontact_id. Anemailthat isn't a contact yet becomes one when a live automation that needs a contact starts from the event (subscribed, no topics chosen, likePOST /contacts, its consent sourceevent; it counts against the plan's contacts);create_contact: falseopts 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_keyso a retried request emits once. - The first event with a new name registers it.
GET /v1/events/definitionslists 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_scopesays so): create a new Sending key. Webhook endpoints can subscribe to your event names too.
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 indata, 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
429that recorded nothing, safe to send again afterRetry-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 -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
| Field | Type | What it is |
|---|---|---|
automation_id | string | The automation (atm_…). |
name | string | Its name when the event happened. |
status | string | paused. |
pause_reason | string | Why 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. |
{
"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
| Field | Type | What it is |
|---|---|---|
automation_id | string | The automation (atm_…). |
name | string | Its name when the event happened. |
status | string | active. |
pause_reason | null | Always null on a resume. |
{
"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
| Field | Type | What it is |
|---|---|---|
automation_id | string | The automation (atm_…). |
name | string | Its name when the event happened. |
run_id | string | The run (run_…). Read it with GET /v1/automations/runs/{id} for the step and its error, which the webhook never carries. |
version | number | null | The published version the run was on. |
contact_id | string | null | The contact (con_…), never an address; null for a run with no contact. |
failed_block | object | null | { id, kind, title } of the block it failed at; null when it failed outside a block (the step limit, billing, a broken version). |
reason | string | Why: block_failed, max_steps, billing_rejected, definition_invalid, unknown_block, other. |
failed_at | string | When the run failed (ISO 8601, UTC). |
{
"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.