DeckleDocs
Dashboard

API reference

Automations

Create and manage event-driven workflows: a trigger plus an ordered graph of steps.

An automation is a trigger and a list of steps that form a forward-only graph. New automations start as draft; set them live to run.

The automation object#

json
{
  "id": "auto_9k8j7h",
  "name": "Welcome series",
  "status": "live",
  "trigger": { "event": "contact.subscribed" },
  "steps": [
    { "id": "step-0", "type": "email", "detail": "Welcome",
      "templateId": "tmpl_123", "next": "step-1" },
    { "id": "step-1", "type": "delay", "delayMinutes": 1440, "next": null }
  ],
  "step_count": 2,
  "created_at": "2026-07-10T10:30:00.000Z",
  "updated_at": "2026-07-10T10:30:00.000Z"
}

Triggers#

A trigger is one of:

json
{ "event": "contact.subscribed" }
{ "event": "event", "name": "order.completed" }

Step types#

typeKey fieldsWhat it does
emailtemplateId, subjectOverride?Sends a template to the enrolled contact.
delaydelayMinutes (1–525600)Waits a fixed amount of time.
waitwaitEvent, waitTimeoutMinutes (1–36000)Pauses until an event arrives or the timeout elapses.
branchbranchCondition, nextTrue, nextFalseTwo-way if/else on a field, operator, and value.
actionaction, actionKey?, actionValue?, tag?unsubscribe, update-field, add-tag, or remove-tag.

Every step has an id (unique) and an optional next pointer. Omit next to fall through to the following step; set it to null to end the run. Pointers must move forward — backward or dangling references are dropped.

List automations#

GET/v1/automations

Query parameters

limitintegerOptional
Items per page. Default 50, max 100.
cursorstringOptional
Pagination cursor.
status"draft" | "live"Optional
Filter by status.
ts
const { data } = await deckle.automations.list({ status: "live" });

Create an automation#

POST/v1/automations

Body parameters

namestringRequired
Name, up to 120 characters.
triggerobjectOptional
Trigger config. Defaults to { "event": "contact.subscribed" }.
stepsobject[]Optional
Ordered steps. Ids must be unique; missing ids are generated.
const automation = await deckle.automations.create({
  name: "Welcome series",
  trigger: { event: "contact.subscribed" },
  steps: [
    { id: "step-0", type: "email", detail: "Welcome", templateId: "tmpl_123" },
    { id: "step-1", type: "delay", detail: "", delayMinutes: 1440 },
  ],
});

Retrieve an automation#

GET/v1/automations/:id
ts
const automation = await deckle.automations.get("auto_9k8j7h");

Update an automation#

PATCH/v1/automations/:id

Update name, trigger, steps, or status.

ts
// Turn it on — resumes any paused enrollments.
await deckle.automations.update("auto_9k8j7h", { status: "live" });

Going live

Setting status to live resumes paused enrollments. An invalid status or duplicate step ids return 422.

Delete an automation#

DELETE/v1/automations/:id
await deckle.automations.delete("auto_9k8j7h");