Emails
Update Email Blocks
Replace an email body or mutate an existing block type.
PATCH
Update Email Blocks
You can replace an email body with raw HTML or structured blocks. You can also mutate an existing block between
text and html.
The double opt-in confirmation email (consent.doubleOptInEmailId in tracking settings) can be edited here too. A new body for it must keep the {{DOUBLE_OPT_IN_URL}} link, otherwise the request returns 400 and nothing is saved.
Request
Structured email blocks. Replaces all existing blocks. Put block styling under
styles; top-level style keys like backgroundColor, backgroundOpacity,
textColor, textAlign, borderColor, borderWidth, and borderRadius are
normalized into styles.Fields that are not part of a block’s schema are discarded rather than
rejected, so the request still succeeds. When that happens the response
includes a
warnings array naming each ignored field and listing the fields
that block does accept. Check warnings before treating a 200 as “every field
I sent took effect”. See Block styling vs block
fields.Custom video thumbnails
SetthumbnailUrl on a YouTube video block to override YouTube’s still. This
endpoint replaces the blocks array, so omit thumbnailUrl in the replacement
block to clear the custom cover. The click destination always remains
videoUrl.
Block styling vs block fields
styles holds the layout and background of the block’s own container - the band
the block sits in. Some blocks render an inner element whose appearance is
controlled by dedicated top-level fields instead. Setting the styles key
changes the band, not the inner element.
The button block is the common case:
Leave
buttonColor and buttonTextColor unset to inherit the email theme’s
primary color.
Body copy color is styles.textColor (or the top-level textColor alias). An
inline style on the <p> or <span> inside a text block’s content is not
the field the editor and theme use.