API referenceAutomations

Create a draft automation

POST
/v1/automations

name + a valid trigger_kind are required; everything else can be filled in via PATCH before activation. steps (default []) is validated by email_core::validate_steps when supplied — see AutomationStep for the per-type shape and forward-only jump rule (loops are structurally impossible).

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <key>. Looked up by SHA-256 hash (email_core::sha256_hex) against api_keys.hash; revoked keys and keys belonging to a suspended tenant are rejected. See the top-level Authentication section for permission levels.

Request Body

application/json
  1. body
name*string
trigger_kind*string
Value in"contact_created""audience_added""manual"
trigger_config?

{"audience_id": "<owned audience id>"} when trigger_kind is audience_added; ignored/{} otherwise.

Default{}
from_domain_id?string

A verified sending domain id — required before activate will succeed.

steps?array<|||>
Itemsitems <= 50
Default[]

Response Body

Created.

application/json
  1. response
id?string
name?string
trigger_kind?string
Value in"contact_created""audience_added""manual"
trigger_config?
from_domain_id?string|null
steps?array<|||>
status?string
Value in"draft""active""paused""archived"
created_at?integer
Formatint64
updated_at?integer
Formatint64
curl -X POST "https://example.com/v1/automations" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "trigger_kind": "contact_created"  }'
{  "id": "string",  "name": "string",  "trigger_kind": "contact_created",  "trigger_config": {},  "from_domain_id": "string",  "steps": [    {      "type": "send",      "subject": "string",      "body_html": "string",      "body_text": "string"    }  ],  "status": "draft",  "created_at": 0,  "updated_at": 0}