Skip to main content
PATCH
Update Email Blocks

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.

Request

string
required
Email ID.
string
Raw HTML body. Replaces all blocks with a native HTML body.
array
Structured email blocks. Replaces all existing blocks. Put block styling under styles; top-level style keys like backgroundColor, backgroundOpacity, 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.
string
Existing block ID to mutate.
string
New block type. Type mutation supports text and html.
string
Optional replacement content for the mutated block.

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.

Responses