contentRevisionId, edit the LMX in Git, and send the update back with
revision protection.
Campaign content examples
Create campaigns, query themes and components, and update email messages with LMX.
Update email message API
Send serialized LMX through the Content API for campaign and transactional email messages.
Create campaign API
Create a draft campaign and email message before adding LMX content.
Loops CLI
Use the CLI for local setup, authentication, and Content API workflows.
Themes API
Find theme IDs and style attributes for the LMX
<Style /> tag.Components API
Find reusable components for the LMX
<Component /> tag.LMX examples
Here are some examples of how to use LMX tags to create emails.Core rules
- LMX is XML, not HTML or Markdown. Tags are case-sensitive (for example,
<Paragraph>, not<paragraph>). - LMX is not MJML. Do not use MJML tags (such as
<mj-text>). - Do not use the editor’s dynamic tag syntax in LMX documents (for example
{DATA_VARIABLE:resetLink}or unprefixed{firstName}). Use{contact.X}for campaign contact properties and{data.X}for transactional email data variables. - A document is a sequence of top-level block tags, optionally with one top-level
<Style />. - Text is not allowed at the top level. Wrap top-level text in a block tag like
<Paragraph>. - Top-level inline tags and variables are invalid.
- Required attributes must be present (for example,
<Image />requiressrc). - Self-closing tags must end with
/>(for example,<Image ... />,<Br />). - Unknown tags are rejected. Use only documented attributes in public LMX examples.
- Attribute values are quoted strings. Numbers and booleans are passed as strings.
- Whitespace in text content collapses like HTML, except inside
<CodeBlock>, where interior whitespace is preserved. Use<Br />for explicit line breaks. - Whitespace between block tags is ignored, so pretty-printing is safe.
- Escape text and attributes as needed (
<,&,").
Emails automatically have a footer appended, so you don’t need to include your address or unsubscribe link at the bottom of your LMX content.
Tags
Top-level tags define the structure of an email.| Tag | Description | Self-closing |
|---|---|---|
<Style /> | Style metadata (top-level only) | yes |
<H1>, <H2>, <H3> | Heading blocks | |
<Paragraph> | Paragraph block | |
<Quote> | Quote block | |
<CodeBlock> | Code block | |
<Button> | Button block | |
<Image /> | Image block | yes |
<Divider /> | Divider block | yes |
<OrderedList> | Numbered list container | |
<UnorderedList> | Bulleted list container | |
<Columns> | Multi-column container | |
<Component> | Component container | yes, but can contain children |
<Section> | Section container | |
<Icons> | Social icon group |
| Tag | Parent tag | Description | Self-closing |
|---|---|---|---|
<Br /> | Inline-content blocks | Line break | yes |
<ListItem> | <OrderedList>, <UnorderedList> | List item | |
<ColumnItem> | <Columns> | Column content container | |
<Icon /> | <Icons> | Individual icon | yes |
Tag reference
Document styles
Use the optional top-level<Style /> tag to style the email. Use this to apply a theme to your email and add custom styles, just like you would in the Style panel in the editor.
Use a combination of themeId and other attributes to bring in defaults while also overriding specific styles. You can also style individual elements in your email using tag attributes (for example, <Button bgColor="#000000">Open account</Button> overrides <Style buttonBodyColor="#CCCCCC" /> for that button).
Styles applied in <Style /> will apply to all content in the email. For example, defining buttonBodyColor in the <Style /> tag will apply to all buttons in the email.
Self-closing tag. At most one per document.
| Attribute | Notes |
|---|---|
themeId | Theme preset ID to load as the base style before applying overrides. |
backgroundColor | Outer email hex background color around the body container. |
backgroundXPadding | Left and right spacing (px) between the outer background and body container. |
backgroundYPadding | Top and bottom spacing (px) between the outer background and body container. |
bodyColor | Main body container hex background color. |
bodyXPadding | Left and right inner padding (px) inside the body container. |
bodyYPadding | Top and bottom inner padding (px) inside the body container. |
bodyFontFamily | Font family from Google Fonts e.g. "Inter", "Noto Sans" |
bodyFontCategory | Fallback font category. Must be one of: "ui-sans-serif", "ui-serif", "ui-monospace", "sans-serif", "serif", "monospace". |
borderColor | Default hex border color for the body container. |
borderWidth | Border width (px) for the body container. |
borderRadius | Corner radius (px) for the body container. |
buttonBodyColor | Default hex background color applied to buttons. |
buttonBodyXPadding | Default left and right internal button padding (px). |
buttonBodyYPadding | Default top and bottom internal button padding (px). |
buttonBorderColor | Default hex border color for buttons. |
buttonBorderWidth | Default button border width (px). |
buttonBorderRadius | Default button corner radius (px). |
buttonTextColor | Default hex text color used in buttons. |
buttonTextFontSize | Default button text size (px). |
dividerColor | Default hex line color used by <Divider />. |
dividerBorderWidth | Default line thickness (px) used by <Divider />. |
textBaseColor | Default hex color for paragraph, quote, and list text. |
textBaseFontSize | Default font size (px) for paragraph, quote, and list text. |
textBaseLineHeight | Default line height (percentage) for body text. |
textBaseLetterSpacing | Default letter spacing (px) applied to body text. |
textLinkColor | Default hex text color for inline <Link>. |
heading1Color | Default hex text color for <H1>. |
heading1FontSize | Default font size (px) for <H1>. |
heading1LineHeight | Default line height (percentage) for <H1>. |
heading1LetterSpacing | Default letter spacing (px) for <H1>. |
heading2Color | Default hex text color for <H2>. |
heading2FontSize | Default font size (px) for <H2>. |
heading2LineHeight | Default line height (percentage) for <H2>. |
heading2LetterSpacing | Default letter spacing (px) for <H2>. |
heading3Color | Default hex text color for <H3>. |
heading3FontSize | Default font size (px) for <H3>. |
heading3LineHeight | Default line height (percentage) for <H3>. |
heading3LetterSpacing | Default letter spacing (px) for <H3>. |
Headings
Use<H1>, <H2>, and <H3> for headings.
| Attribute | Type | Notes |
|---|---|---|
fontSize | number | |
lineHeight | number | Percentage value such as "150" |
align | string | "left" (default), "center", "right" |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Paragraphs
Use<Paragraph> for paragraph text.
| Attribute | Type | Notes |
|---|---|---|
fontSize | number | |
lineHeight | number | Percentage value such as "150" |
align | string | "left" (default), "center", "right" |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Quotes
Use<Quote> for blockquote content.
| Attribute | Type | Notes |
|---|---|---|
fontSize | number | |
lineHeight | number | Percentage value such as "150" |
align | string | "left" (default), "center", "right" |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Code blocks
Use<CodeBlock> for code blocks.
Note: inline tags and variable parsing are disabled inside code blocks.
| Attribute | Type | Notes |
|---|---|---|
fontSize | number | |
lineHeight | number | Percentage value such as "150" |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Buttons
Use<Button> for buttons.
Button content may contain plain text and dynamic content variables such as {contact.firstName} or {data.firstName}. Inline formatting tags are not allowed inside buttons.
| Attribute | Type | Required | Notes |
|---|---|---|---|
href | url | The button’s URL. May contain dynamic variables | |
align | string | "left" (default), "center", "right" | |
notrack | boolean | "true" disables link tracking | |
bgColor | hex | ||
textColor | hex | ||
borderRadius | number | ||
borderWidth | number | ||
borderColor | hex | ||
innerXPadding | number | Inner padding of the button content | |
innerYPadding | number | Inner padding of the button content | |
fontSize | number | ||
blockColor | hex | ||
blockBorderRadius | number | ||
paddingTop | number | Padding of the container block | |
paddingRight | number | Padding of the container block | |
paddingBottom | number | Padding of the container block | |
paddingLeft | number | Padding of the container block |
Images
Use<Image /> for images.
src must be a Loops-hosted image. Upload images using the Uploads API endpoints and use the returned URL as src.
For an externally hosted dynamic image, see Dynamic images below.
Dynamic or externally hosted images
If you want a per-recipient image URL, setdynamicSrc to a URL containing a variable (for example, {contact.avatarUrl} or {data.avatarUrl}). The image URL should come from a contact property or data variable.
You must also set src to a Loops-hosted static placeholder (this image renders in the Loops editor). When the email is generated for each recipient, the resolved dynamicSrc value is injected as the image src.
For images hosted on an external host, set src to a Loops-hosted static placeholder, then set dynamicSrc to the external image URL.
Dynamic image URLs must be publicly accessible and use an email-safe image extension like .jpg or .png.
More about dynamic images.
| Attribute | Type | Required | Notes |
|---|---|---|---|
src | url | yes | Loops-hosted image URL from the Uploads API. User-hosted URLs are not supported. |
dynamicSrc | string | Per-recipient image URL from a contact property, such as {contact.avatarUrl}. See dynamic images. | |
notrack | boolean | "true" disables link tracking | |
alt | string | Alt text | |
href | url | Add a link to the image. May contain dynamic variables | |
width | number | Pixel width, maximum is 600px. Default is full width (600px). If you add padding, width will auto-adjust to be maximum 600px. | |
align | string | "left" (default), "center", "right" | |
borderRadius | number | ||
borderWidth | number | ||
borderColor | hex | ||
blockColor | hex | Background color of the container block | |
blockBorderRadius | number | Border radius of the container block | |
paddingTop | number | ||
paddingRight | number | ||
paddingBottom | number | ||
paddingLeft | number |
Dividers
Use<Divider /> for divider lines.
Self-closing tag.
| Attribute | Type | Notes |
|---|---|---|
align | string | "left" (default), "center", "right" |
width | number | Percentage value |
borderWidth | number | |
color | hex | Color of the divider line |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Line breaks
Use<Br /> for line breaks in inline contexts. It is not valid at the top level.
Self-closing tag.
Lists
Use<OrderedList> or <UnorderedList> with <ListItem> children only.
These tags must contain at least one <ListItem>.
| Attribute | Type | Notes |
|---|---|---|
align | string | "left" (default), "center", "right" |
start | number | Item number to start at (ordered lists only) |
List items
Use<ListItem> for list items.
Only valid inside <OrderedList> and <UnorderedList> tags.
Can only contain inline content.
| Attribute | Type | Notes |
|---|---|---|
fontSize | number | |
lineHeight | number | Percentage value such as "150" |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
Columns
Use<Columns> for columns.
Must contain between two and four <ColumnItem> children. No other tags are allowed.
Nested <Columns> tags are not supported.
| Attribute | Type | Notes |
|---|---|---|
gap | number | Space between columns (px) |
widths | string | Comma-separated percentages, one for each column, must total 100. |
verticalAlignment | string | "top", "middle", "bottom" |
stackOnMobile | boolean | |
reverseOnMobile | boolean | |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
<ColumnItem> for column content containers.
Only valid inside a <Columns> tag.
No attributes.
Components
Use<Component> to add a component.
Can be self-closing, or can contain block elements, which will override the component’s default content.
Children are block tags. Nested <Component> tags are not supported.
| Attribute | Type | Required | Notes |
|---|---|---|---|
componentId | string | yes | The component’s ID |
blockColor | hex | ||
blockBorderRadius | number | ||
paddingTop | number | ||
paddingRight | number | ||
paddingBottom | number | ||
paddingLeft | number |
Sections
Use<Section> to group related block content in a shared clickable or styled container.
Children are block tags. Nested <Section> tags are not supported.
| Attribute | Type | Required | Notes |
|---|---|---|---|
href | url | Section link URL. May contain dynamic variables | |
notrack | boolean | "true" disables link tracking | |
blockColor | hex | ||
blockBorderRadius | number | ||
paddingTop | number | ||
paddingRight | number | ||
paddingBottom | number | ||
paddingLeft | number |
Icons
Use<Icons> for lists of icons.
Children must be <Icon /> with no other tags allowed. At least one <Icon /> child is required (maximum 100).
| Attribute | Type | Notes |
|---|---|---|
align | string | "left" (default), "center", "right" |
gap | number | Space between icons (px) |
size | number | Icon size (px) |
color | hex | #000000 (black, default), #808080 (gray), #FFFFFF (white) |
blockColor | hex | |
blockBorderRadius | number | |
paddingTop | number | |
paddingRight | number | |
paddingBottom | number | |
paddingLeft | number |
<Icon /> for individual icons.
Self-closing tag. Only valid inside an <Icons> tag.
| Attribute | Type | Required | Notes |
|---|---|---|---|
name | string | yes | Icon name (available icons listed here) |
href | url | A URL for the icon | |
notrack | boolean | "true" disables link tracking |
Inline tags
Inline tags format text content inside block elements.| Tag | Description |
|---|---|
<Strong> | Bold text |
<Em> | Italic text |
<Underline> | Underlined text |
<Code> | Inline code |
<Strike> | Strikethrough text |
<Text> | No format, useful for textColor |
<Link href="..."> | Link with URL |
<Paragraph>, headings, <Quote>, and <ListItem>.
Inline tag attributes
| Tag | Attribute | Type | Required | Notes |
|---|---|---|---|---|
<Strong> | textColor | hex | ||
<Em> | textColor | hex | ||
<Underline> | textColor | hex | ||
<Code> | textColor | hex | ||
<Strike> | textColor | hex | ||
<Text> | textColor | hex | ||
<Link> | href | url | yes | May contain dynamic variables |
<Link> | notrack | boolean | "true" disables link tracking |
Dynamic content
You can add dynamic content like contact properties by using a tag syntax with a prefix, for example{contact.firstName}.
Dynamic tags can be added to email message lmx bodies and also in other fields like subject, previewText, fromName, fromEmail and replyToEmail.
LMX campaign content uses contact properties and the public unsubscribe URL. Transactional email content uses data variables.
| Syntax | Variable type | Use case | Example |
|---|---|---|---|
{contact.X} | Contact property | Campaign personalization | {contact.firstName} |
{data.X} | Data variable | Transactional email personalization | {data.resetLink} |
{system.unsubscribe_link} | System URL | Public unsubscribe link | {system.unsubscribe_link} |
Contact properties
Use{contact.<apiName>} for campaign personalization, for example {contact.firstName}.
Default contact properties include firstName, lastName, email, notes, source, userGroup, userId, subscribed, and createdAt.
Data variables
Use{data.<variableName>} in transactional email LMX. The name after data. must match a key in the dataVariables object when sending the email.
LMX content
Send transactional email payload
- Names are case-sensitive.
{data.resetLink}and{data.ResetLink}are different variables. - Names may contain only letters, numbers, underscores, and dashes.
- API values may be
stringornumber. - Non-optional variables must be present in
dataVariablesor the send fails. - Optional variables may be omitted from the request or sent as an empty string
""(nulldoes not work). Mark a data variable as optional in the Loops editor.
Where variables are allowed
Variables are allowed in:- Inline content (headings, paragraphs, quotes, list items, and inline tags)
- Button text
- Supported dynamic attributes:
Buttonhref,Linkhref,Imagealt,Imagehref,ImagedynamicSrc, andSectionhref
- At the top level
- Inside
<CodeBlock>(braces are literal text) - In unsupported attributes such as
Imagesrc
Variables in attributes
Only these attribute values may include variables:ButtonhrefImagealt,href, anddynamicSrcLinkhrefSectionhref
Image src must be a Loops-hosted static URL with no variables. User-hosted URLs are not supported in src. Putting a variable like {contact.avatarUrl} in src is not supported and validation returns unsupported_dynamic_attr. When the image URL should vary per recipient (including externally hosted URLs), set dynamicSrc to a variable such as {contact.avatarUrl} or {data.avatarUrl} and keep src as a Loops-hosted placeholder; at send time, the resolved dynamicSrc value replaces src.
Fallback values
LMX does not support inline fallback syntax in variable references. These forms are not valid in LMX:{contact.firstName|there}, {contact.firstName:there}, {contact.firstName ?? "there"}, and fallback="there" on variable attributes.
Use plain variable references in LMX (for example, {contact.firstName} or {data.firstName}). For contact properties, configure fallback values through the Loops editor. For transactional emails, mark a data variable as optional in the editor instead of inventing inline fallback syntax.
Nesting rules
LMX validates structure, not just syntax. A few key rules:- Root-level content must use supported top-level block tags (
H1,H2,H3,Paragraph,Quote,CodeBlock,Button,Image,Divider,OrderedList,UnorderedList,Columns,Component,Section,Icons,Style). - Inline tags cannot appear at the top level.
<ListItem>and<Quote>only accept inline content.<Columns>can only contain<ColumnItem>tags.<ColumnItem>can contain block content, but not nested<Columns>or other<ColumnItem>tags.<Style />is metadata and is only allowed at the top level.

