API referenceAutomations

Edit a draft automation

PATCH
/v1/automations/{id}

Only allowed while status = draft (else 409 not_editable) — editing a live program out from under in-flight enrollments would be unsafe. Fields omitted from the body keep their current value; the trigger is re-validated whenever trigger_kind/ trigger_config is touched.

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.

Path Parameters

id*string

Request Body

application/json
  1. body
name?string
trigger_kind?string
Value in"contact_created""audience_added""manual"
trigger_config?
from_domain_id?string
steps?array<|||>
Itemsitems <= 50

Response Body

Updated.

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 PATCH "https://example.com/v1/automations/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "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}