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”, “a drastically different style”), the AI invents one look for the whole sequence: its own palette, fonts, sizes and shapes, and colors for full-width bands and framed cards. It sketches several directions unlike one another and works one of them out, so asking again gives you something new. Every email is then redesigned in that look, at the same time: the AI rewrites its copy and sets each part in the form that suits it, keeping every fact, list item, table row, link and merge tag, and adding nothing the email didn’t say. An email with images, products or other parts a redesign can’t carry, or one whose redesign loses a fact, keeps its words, links, images and table cells exactly as they are; only how they are set changes, and every text color is kept or shaded until it reads on the background it sits on. Its fonts are ones installed on almost every device, so it looks the same in every inbox, unless your request names another font. An email written in HTML is restyled as HTML instead. If no look can be chosen, the first email is redesigned and the others are restyled in its design, as before. 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
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.Response
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).