Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 2.15 KB

File metadata and controls

39 lines (29 loc) · 2.15 KB

createSequence

Create a sequence: a declared input shape, the steps a contact walks over time, and zero or more triggers. A sequence is a function — input is its signature, and every door must satisfy it, so a step's {{input.field}} means the same thing however it was started. Created as a draft unless you pass status "active". The whole definition is validated up front and every problem is reported at once, so you fix a program in one pass rather than one 400 at a time.

HTTP: POST /v1/sequences

Parameters

Field Type Required Description
name string ✓ Unique handle for this account; 1-64 chars of letters, digits, dot, dash, or underscore…
status string Defaults to draft. A sequence enrolls nobody until it is active.
from string Default sender for every send step, on a verified domain. Required unless every send step…
input object,null The sequence's input signature: the shape every door must supply. A sequence is a…
triggers array Doors into this sequence. A bare string is shorthand for { "event": "" }. Replacing…
steps array ✓ At least one step, and at least one of them a send — a sequence that never sends is a…
reentry string once (default) refuses to enroll a contact already in flight. always restarts them…
exitOn object,null Sequence-level exits, evaluated before EVERY step. goal completes the enrollment — they…

Returns

sequence-response — see the sequence-response schema.

Example

res = mk.createSequence({
    "name": "dunning",
    "status": "active",
    "from": "billing@acme.dev",
    "input": { "invoiceId": { "type": "string", "required": true } },
    "triggers": ["payment.failed", "invoice.overdue"],
    "steps": [{ "type": "delay", "for": "3 days" }, { "type": "send", "templateId": "tpl_8Rt5NmZx", "subject": "Invoice {{input.invoiceId}} is still unpaid" }],
})

← All methods · Docs · mailkite.dev