Welcome sequences API
Each audience has one welcome sequence. While it is on, a reader who subscribes through a signup form or the API gets its emails in order, each after its wait. With double opt-in, the sequence starts when the reader confirms. Readers you add in the dashboard or import never start it, and a reader starts it only once.
Last updated
Get the sequence
/v1/audiences/:id/welcome-sequenceScope newsletters:read. An audience without a sequence returns enabled: false and no steps. A converted sequence that the legacy API cannot represent returns 409 flow_not_linearwith the flow ID in the same error detail. PATCH can still turn that flow on or off. During conversion, a write that would create a legacy sequence returns 409 welcome_sequences_replaced.
{
"object": "welcome_sequence",
"audience_id": "aud_abc123",
"enabled": true,
"paused": false,
"pause_reason": null,
"active_readers": 42,
"completed_readers": 310,
"steps": [
{
"object": "welcome_step",
"id": "nwswstp_abc123",
"position": 1,
"wait_minutes": 0,
"condition": null,
"subject": "Welcome to Acme Weekly",
"blocks": [{ "type": "paragraph", "body": "Thanks for subscribing." }],
"sent_count": 352,
"bounced_count": 1,
"complained_count": 0
}
]
}Turn it on or off
/v1/audiences/:id/welcome-sequenceSend { "enabled": true } or false. Turning it on needs at least one email with a subject and a body. Turning it off holds the emails already queued until it is on again. When bounces or complaints pass the same limits that pause a newsletter, the sequence pauses (paused: true) and the owner gets an email; turning it on again resumes it. A welcome email that fails a blocking content check of a newsletter also pauses the sequence, and turning it on answers 422 until the email passes. Only resuming a bounce or complaint pause accepts the rate; after any other pause, earlier sends still count toward the limits. A spam-trap hit on any newsletter of the organization pauses every welcome sequence.
Add, change and remove emails
POST /v1/audiences/:id/welcome-sequence/steps
PATCH /v1/audiences/:id/welcome-sequence/steps/:stepId
DELETE /v1/audiences/:id/welcome-sequence/steps/:stepIdScope newsletters:write. A key limited to specific recipients, domains or mailboxes gets a 403 here and when turning the sequence on, because the sequence emails every new subscriber. A key limited to specific recipients can still turn the sequence off; one limited to domains or mailboxes cannot. While the sequence is on, such a key also gets a 403 when it adds or resubscribes a subscriber it may not email, and nothing is written. A step accepts:
subject(required on create) andpreview_text.blocksorcontent_markdown, the same body formats as a newsletter.wait_minutes: minutes after the previous email, or after the subscribe for the first one. 0 sends right away; the maximum is 365 days.condition:clickedsends the email only to readers who clicked a link in an earlier welcome email of the audience,not_clickedonly to readers who have not, andnull(the default) to everyone. See Branch on clicks below.sender_identity_id(defaults to the organization's default sender),track_engagement,add_utm_tagsandstyling_mode. Once an email has gone out, asender_identity_idon another sending domain answers422: add a new email for that domain and remove this one.
curl -X POST https://shipmail.to/api/v1/audiences/aud_abc123/welcome-sequence/steps \
-H "Authorization: Bearer $SHIPMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject":"Our three best posts","wait_minutes":4320,"content_markdown":"# Start here\n\n- [Post one](https://example.com/1)"}'Removing an email moves readers waiting for it on to the next one. A running sequence keeps at least one email.
Branch on clicks
A step's condition is checked when the email comes due, after its wait. Only clicks count: opens do not, because Apple Mail Privacy Protection opens every email on arrival. A reader the condition leaves out skips the email: their recipient row reads skipped with the reason condition_not_met, it is not a send, and it takes no room under the audience limit. The next email's wait keeps counting from the last email the reader got.
Clicks count only on emails sent with track_engagement on. Setting a condition turns it on for the emails before that step. A clicked step followed directly by a not_clicked step is a fork: the second goes to exactly the readers the first left out, whatever they click in between, so each reader gets exactly one of the two. Steps with the same condition in a row read the clicks again, so a run of not_clicked reminders stops at the first click. A step after them with no condition goes to everyone. Changing a condition affects only readers who have not reached that step yet.
curl -X PATCH https://shipmail.to/api/v1/audiences/aud_abc123/welcome-sequence/steps/nwswstp_abc123 \
-H "Authorization: Bearer $SHIPMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"condition":"not_clicked"}'How welcome emails are sent
Welcome emails go out like newsletters: the same footer and unsubscribe link, List-Unsubscribe headers, suppressions and opt-outs, and they count toward the monthly newsletter limit. At most 100 welcome emails per audience go out in any ten minutes. When more readers are due, the rest wait for the next ten minutes and the owner gets an email.
SDKs, CLI and MCP
await shipmail.audiences.welcomeSequence.createStep("aud_abc123", {
subject: "Welcome",
content_markdown: "Thanks for subscribing.",
});
await shipmail.audiences.welcomeSequence.update("aud_abc123", { enabled: true });client.audiences.welcome_sequence.create_step(
"aud_abc123", {"subject": "Welcome", "content_markdown": "Thanks for subscribing."}
)
client.audiences.welcome_sequence.update("aud_abc123", {"enabled": True})shipmail audiences welcome add-step aud_abc123 --subject "Welcome" --markdown @welcome.md
shipmail audiences welcome update-step aud_abc123 nwswstp_abc123 --condition clicked
shipmail audiences welcome enable aud_abc123MCP tools: shipmail_get_welcome_sequence, shipmail_update_welcome_sequence, shipmail_create_welcome_step, shipmail_update_welcome_step and shipmail_delete_welcome_step.