Sequences
Edit Sequence Emails with AI
Change a sequence’s emails with AI in one request
POST
Edit Sequence Emails with AI
Changes the emails of a sequence with AI in one request, like the Emails view in the sequence editor. Say what should change in
prompt, in any language: “make the background cream”, “remove the header”, “give email 2 a new structure”.
Without emailIds, the prompt decides which emails change: every email, unless it names some (“email 2”, “the last email”). With emailIds, only those emails change. With sectionIds and exactly one email, only those top-level blocks change and everything else stays exactly as it is.
When the request asks for a new look without saying exactly what (“more premium”, “bolder colors”), the first email is redesigned, then the others are restyled in its design. Every email gets exactly the same theme, and every email’s headings, buttons and other blocks are styled exactly like the first one’s. Kinds of blocks that email doesn’t have, like a callout or a table, are styled like the first email that has them. Text that would no longer be readable on its background gets a readable color. When it asks several emails for the same new text or style, like a new footer line or a button color, the AI decides the wording and values once and puts exactly the same in each email.
A request to make emails look like one of them (“make them all look like email 1”) copies that email’s style exactly, with no AI: its theme, font and the style of each kind of block, while every email keeps its own words. With emailIds, only those emails change; listing only the email to copy returns a 400. A request for design variations of an email (“make a few variations of email 1”) returns a 400 here: use Generate Sequence Email Variations.
Each email succeeds or fails on its own. Changed emails are saved unless dryRun is true, and on an active sequence they go out with the next sends. An email written in HTML is edited as HTML and keeps its theme. A/B test steps and steps without an email are skipped and listed in skipped. To set exact values instead of asking the AI, use Update Sequence.
The request runs synchronously and can take up to a minute. One request edits up to 12 emails; pass emailIds to edit a longer sequence in batches. If your client times out, read the sequence with Get Sequence before sending the request again: changes may already be saved, and sending it again changes them again.
When the AI can’t tell which emails a request without emailIds is about, nothing changes and you get a 503: send it again, or pass emailIds. An email saved somewhere else while the AI worked on it is not overwritten: it comes back with saved: false and an error.
Request
string
required
Sequence ID.
string
required
What should change, 1 to 2,000 characters, in any language.
string[]
Only change these emails (1 to 12), using the
emailId of each step from
Get Sequence. Omit to let the prompt decide.
An ID that is not an editable email of this sequence is a 400.string[]
Only change these top-level blocks (up to 50). Needs exactly one
emailIds
entry.boolean
default:"false"
Return the new content without saving it.
Response
boolean
Whether the changes were only returned, not saved.
object[]
One entry per email the request worked on, in sending order.
object[]
Email steps the AI can’t edit here, each with
nodeId, label, emailId
(null when there is none) and reason: ab_test (edit each variant with
Update A/B Test Variant), no_email, or shared_email (the step sends
the same email as an earlier one, which is edited once).