Templates
Duplicate a template
POST/v1/templates/{id}/duplicate
Requires an API key with the templates:write scope. About keys and scopes
Copies a template's blocks and theme (its draft) into a new template, published as version 1, as on create.
Path parameters
idstringrequireduuid
Returns
Returns 201 Created with a Template in data. Otherwise returns an error; Errors lists every code and which to retry.
idstringrequireduuid
namestringrequiredschemaVersionintegerrequiredThe block format version.
min > 0 · max 1000
blocksEmailBlock[]requiredAt most 200 blocks across the entire tree and five levels including the root. Footer blocks must remain at root. Known child fields are validated recursively.
at least 1 item · at most 200 items
7 child attributes
idstringrequiredIdentifies the block within the template; unique among its blocks.
1–128 characters
typestringrequiredThe block type:
header,heading,text,image,button,divider,spacer,columns,columns3,imagetext,imagegroup,boxed,quote,list,product,video,social,menu,html,section,footer,repeat,shared. Each type reads its own fields next totype; an unknown type is kept but not validated.1–64 characters
styleEmailBlockStyleoptionalVisual overrides for this block, such as colours, font and spacing.
17 child attributes
backgroundColorstringoptionalFill behind the block.
fontFamilystringoptionalA font every client has (Arial, Verdana, Georgia, Tahoma, Times New Roman, Courier New), or a web font, which shows where the client loads it and falls back to a safe font elsewhere.
one of
Arial,Verdana,Georgia,Tahoma,Times New Roman,Courier New,Inter,Roboto,Open Sans,Lato,Montserrat,Poppins,DM Sans,Nunito,Work Sans,Oswald,Playfair Display,Merriweather,Lora,Libre Baskerville,EB GaramondfontSizeintegeroptionalText size in px, 12 to 72.
min 12 · max 72
mobileFontSizeintegeroptionalText size in px on phones (screens up to 620px), 12 to 72.
min 12 · max 72
paddingobjectoptionalSpace inside the block in px, 0 to 100 per side; omitted sides keep their default.
4 child attributes
topintegeroptionalmin 0 · max 100
rightintegeroptionalmin 0 · max 100
bottomintegeroptionalmin 0 · max 100
leftintegeroptionalmin 0 · max 100
borderWidthintegeroptionalBorder thickness in px; 0 for none.
min 0 · max 10
borderStylestringoptionalBorder line style.
one of
solid,dashed,dottedborderColorstringoptionalBorder colour.
borderRadiusintegeroptionalCorner rounding in px, 0 to 100.
min 0 · max 100
textColorstringoptionalText colour.
linkColorstringoptionalColour of links in the text.
letterSpacingnumberoptionalSpace between letters in px, such as 3 for a spaced-out eyebrow line.
min -2 · max 20
textTransformstringoptionalSet to
uppercaseto capitalise all text.one of
none,uppercaselineHeightnumberoptionalA multiple of the font size.
min 1 · max 3
fontWeightstringoptionalText weight.
one of
regular,boldfontStylestringoptionalText style.
one of
normal,italicinsetbooleanoptionalDraw the background and border as a box within the content width, not across the whole row.
visibleIfobjectoptionalShow the block only to contacts these segment rules match, checked as each message is rendered. Omit to show it to everyone. Not allowed on the footer.
One of 2 shapes
- Match all
1 child attribute
allobject[]requiredEvery rule or nested group must match.
at least 1 item · at most 20 items
- Match any
1 child attribute
anyobject[]requiredAt least one rule or nested group must match.
at least 1 item · at most 20 items
showOnstringoptionalShow the block only on phones (screens up to 620px) or only on wider screens. Clients that ignore screen size show the desktop version, and so does plain text. Omit to show it everywhere. Not allowed on the footer.
one of
mobile,desktopcolumnsobject[][]optionalNested child block arrays: exactly two for columns, three for columns3. Each child follows this block contract. Omit to retain legacy text columns.
at most 3 items
blocksobject[]optionalA section's child blocks, drawn inside its box; or a repeat block's, written out once per item of its
list, where{{ item.<field> }}reads that item. Repeats do not nest.at most 200 items
themeEmailThemerequiredTheme values this email overrides.
11 child attributes
fontstringoptionalBody font stack, such as
Inter, sans-serif.up to 200 characters
hfontstringoptionalHeading font stack.
up to 200 characters
bgstringoptionalBackground of the email card, as hex.
canvasstringoptionalBackground behind the card, as hex.
textstringoptionalDefault text colour, as hex.
accentstringoptionalBrand colour for buttons and highlights, as hex.
linkstringoptionalLink colour, as hex.
widthstringoptionalWidth of the email card on wide screens.
one of
560px,600px,680pxradiusstringoptionalCorner rounding of the email's card.
one of
0px,6px,12px,16px,24px,999pxbtnRadiusstringoptionalButton corners;
radiusrounds the email's card and, when this is unset, buttons.one of
0px,6px,12px,16px,24px,999pxbtnstringoptionalButton style.
one of
solid,outline
plainTextOverridestring | nullrequiredPlain text sent instead of the version generated from the blocks.
subjectstring | nullrequiredWhat an API send by
templateIduses by default.previewTextstring | nullrequiredWhat an API send by
templateIduses by default.fromstring | nullrequiredWhat an API send by
templateIduses by default.replyTostring | nullrequiredWhat an API send by
templateIduses by default.email
aliasstring | nullrequiredThe name an API send may use in
templateId.publishedVersioninteger | nullrequiredThe version API sends use; null until published. The template itself is the draft.
min > 0 · max 9007199254740991
hasUnpublishedChangesbooleanrequiredThe draft differs from the published version, or was never published.
revisionintegerrequiredRaised by every edit. Send it back as
expectedRevisionon the update so a change made since you read it is refused instead of overwritten.min > 0 · max 2147483647
thumbnailUrlstring | nullrequiredA small picture of the design (WebP, 320 × 427), redrawn a few seconds after each save; null until the first is drawn.
uri
thumbnailUpdatedAtstring | nullrequiredWhen the thumbnail was last drawn.
date-time
createdAtstringrequireddate-time
updatedAtstringrequireddate-time