mailkite_create_sequence
Create email sequences with steps, triggers, and input signatures, validating the entire definition at once so you fix all errors in one pass.
Instructions
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. Requires an API key (mk_live_…).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Default sender for every send step, on a verified domain. Required unless every send step carries its own `from`, or trigger.type is "send" (which inherits the triggering message's sender). | |
| name | Yes | Unique handle for this account; 1-64 chars of letters, digits, dot, dash, or underscore, starting alphanumeric. | |
| input | No | The sequence's input signature: the shape every door must supply. A sequence is a function and this is how you declare its parameters — steps then read them as {{input.field}}, and a condition can branch on them. Omit it entirely for "anything goes"; you should not need a schema to write a two-step drip. | |
| steps | Yes | At least one step, and at least one of them a `send` — a sequence that never sends is a no-op that still costs a row per contact. | |
| exitOn | No | Sequence-level exits, evaluated before EVERY step. `goal` completes the enrollment — they did the thing, stop chasing, which is the difference between a dunning sequence and harassment. `cancel` abandons it. | |
| status | No | Defaults to `draft`. A sequence enrolls nobody until it is `active`. | |
| reentry | No | `once` (default) refuses to enroll a contact already in flight. `always` restarts them: the in-flight enrollment is canceled and a new one begins. `cooldown:<duration>` (e.g. "cooldown:30 days") re-enrolls only when that long has passed since their last enrollment. | |
| triggers | No | Doors into this sequence. A bare string is shorthand for { "event": "<name>" }. Replacing the set never bumps the sequence's version and never touches an enrollment in flight. A sequence with no triggers is enrolled only by naming it on a send or calling enroll — which is what "manual" used to mean. |