Email Content

Intro

Endpoint: https://api.omnisend.com/api/email-content

Use this API to read and replace the content of an email. The content ID is the same as the template id returned when a template is created.

Content structure

Content follows a strict hierarchy:

Content
  └── Sections[]
        └── Rows[]
              └── Columns[]
                    └── Blocks[]
  • Sections are the top-level content containers. Each section can have its own styling, visibility settings, and optional features like product recommenders or conditional filters.
  • Rows group columns horizontally within a section.
  • Columns define the layout width and contain blocks.
  • Blocks are the actual content elements (text, images, buttons, etc.).

Every section, row, column, and block requires a unique id within the content.

Section types

Each section's type field determines its functionality. Content can mix multiple section types.

TypeDescription
""Plain layout section (or omit the type field)
products_listingManually selected products — one product block per picked product
product_recommenderPersonalized product recommendations — requires a productRecommender object on the section, up to 12 product blocks
product_cart_recoveryAbandoned-cart recovery (used in cart-abandonment automations) — recipient's cart items are injected at send time, up to 12 product blocks
product_back_in_stockBack-in-stock automation — restocked products are injected at send time, up to 12 product blocks
universal_layoutWraps a saved universal layout — set universalLayoutID in its settings; the layout's content is resolved at read time
dynamic_listRepeats its content over a list (e.g. ordered products) — configured via dynamicList in its settings
preheader"View in browser" preheader (campaign content only)
badgeOmnisend badge (read-only, free-plan only)

Note: Product sections only accept product blocks. For dynamic sections (product_recommender, product_cart_recovery, product_back_in_stock), each block is a slot that the platform fills with a personalized product per recipient at send time.

Block types

TypeDescription
textRich text content with HTML formatting and personalization tags
buttonClickable button with link, text, and styling
imageImage with optional link, alt text, and resize settings
videoVideo thumbnail with link
logoBrand logo with link
menuMenu of links — items provided via components as text blocks with role menu_text
socialSocial media icon links
htmlCodeCustom HTML with separate style and body content
lineSpaceHorizontal line or spacer for layout separation
preheader"View in browser" link text (campaign content only)
productProduct card with title, image, price, and button
discountDiscount code block
staticDiscountStatic discount code (WooCommerce)
dynamicDiscountDynamic discount code (WooCommerce)
orderSummaryOrder identification details
orderProductsOrdered product list
orderTotalPricing breakdown
orderAddressesBilling and shipping addresses

Note: The html block type is deprecated and read-only. Use htmlCode instead.

Style presets

Content uses button presets and text presets for consistent styling across blocks.

If you provide buttonPresets, you must include these three required presets:

| primary_button | secondary_button | tertiary_button |

If you provide textPresets, you must include these five required presets:

| heading_large | heading_medium | heading_small | paragraph | footnote |

Additional custom presets can be added alongside the required ones.

Universal layout references

A content section can reference a universal layout via universalLayoutID in its settings. When set, the section acts as a lightweight pointer — the layout's content is resolved at read time.

When updating content, sections with a universalLayoutID are stored as references only; their rows content is ignored.

Product recommender configuration

Sections with type: "product_recommender" require a productRecommender object on the section. It configures the strategy used to generate recommendations at send time and the filters that narrow the candidate set.

FieldDescription
typeRecommender strategy (see strategies table below)
fallbackTypeStrategy used when type returns no results. Allowed values: newest, popular, mostViewed
isOutOfStockIncludedWhether to include out-of-stock products (default: false)
includeCategoriesCategory IDs to include in recommendations
excludeCategoriesCategory IDs to exclude from recommendations
excludeProductsProduct IDs to exclude from recommendations
purchaseExclusionDaysSkip products purchased in the last N days
recencyMonthsTime window in months for recency-based strategies
priceFromMinimum product price

The type field selects from these strategies:

typeDescriptionPlan
newestMost recently added productsAll plans
popularBest-selling productsAll plans
mostViewedMost-viewed products across all recipientsAll plans
personalizedItems similar to the recipient's past purchasesPro plan
recentlyViewedProducts the recipient recently viewedPro plan

Note: personalized and recentlyViewed require the Personalized product recommender feature (Pro plan). The API accepts both types regardless of plan; for brands without the feature, the recommender silently substitutes the section's fallbackType at send time. If fallbackType is itself a personalized strategy, it falls back to newest. No error is returned.

General settings

generalSettings controls the global appearance of the email.

FieldDescription
contentEmail canvas: width, background color, font family, font size, text color
bodyOuter body background color and optional background image
buttonPresetsReusable button styles referenced by blocks via stylePresetID
textPresetsReusable text styles referenced by blocks via stylePresetID
logoShared logo settings (link, resize width)
gmailGmail annotation settings for the promotions tab

Content locking

Content becomes locked when an associated campaign starts sending. Attempting to update locked content returns 409 Conflict.

Warning: Content used in a completed campaign send is permanently locked and cannot be modified through the API.

Constraints

ConstraintValue
sectionsAt least 1 required
Columns per rowMax 4
Column widthMax 100% or max 2000px
Unsubscribe linkRequired — at least one text or HTML block must contain [[unsubscribe_link]]
IDs (path parameter)24-character hexadecimal

Example: Update email content

PUT /api/email-content/{id} replaces the entire content structure. You must provide the full generalSettings and all desired sections — omitted sections are deleted.

curl --request PUT \
     --url https://api.omnisend.com/api/email-content/68beca12d2e99b0c8d19fd5e \
     --header 'Authorization: Omnisend-API-Key YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Omnisend-Version: 2026-03-15' \
     --data '{
  "generalSettings": {
    "content": {
      "backgroundColor": "#FFFFFF",
      "width": "600px",
      "fontFamily": "Arial, sans-serif",
      "fontSize": "16px",
      "color": "#212121"
    },
    "logo": {
      "id": "6985dd9a02eca41c40466abf",
      "source": "/image/newsletter/6985dd9a02eca41c40466abf",
      "altText": "logo",
      "width": 248,
      "height": 86
    },
    "body": {
      "backgroundColor": "#EDEEF0"
    },
    "buttonPresets": [
      {
        "id": "primary_button",
        "name": "Primary",
        "styles": {
          "backgroundColor": "#383838",
          "borderRadius": "4px",
          "fontFamily": "Arial, sans-serif",
          "fontSize": "16px",
          "color": "#FFFFFF",
          "paddingLeft": "24px",
          "paddingRight": "24px",
          "paddingTop": "12px",
          "paddingBottom": "12px"
        }
      },
      {
        "id": "secondary_button",
        "name": "Secondary",
        "styles": {
          "backgroundColor": "#FFFFFF",
          "border": "2px solid #383838",
          "borderRadius": "4px",
          "fontFamily": "Arial, sans-serif",
          "fontSize": "16px",
          "color": "#383838",
          "paddingLeft": "24px",
          "paddingRight": "24px",
          "paddingTop": "12px",
          "paddingBottom": "12px"
        }
      },
      {
        "id": "tertiary_button",
        "name": "Tertiary",
        "styles": {
          "backgroundColor": "transparent",
          "borderRadius": "0px",
          "fontFamily": "Arial, sans-serif",
          "fontSize": "16px",
          "textDecoration": "underline",
          "color": "#383838",
          "paddingLeft": "24px",
          "paddingRight": "24px",
          "paddingTop": "12px",
          "paddingBottom": "12px"
        }
      }
    ],
    "textPresets": [
      {
        "id": "heading_large",
        "name": "Heading Large",
        "styles": {
          "fontFamily": "Arial, sans-serif",
          "fontSize": "36px",
          "color": "#212121",
          "lineHeight": "125%"
        }
      },
      {
        "id": "heading_medium",
        "name": "Heading Medium",
        "styles": {
          "fontFamily": "Arial, sans-serif",
          "fontSize": "28px",
          "color": "#212121",
          "lineHeight": "130%"
        }
      },
      {
        "id": "heading_small",
        "name": "Heading Small",
        "styles": {
          "fontFamily": "Arial, sans-serif",
          "fontSize": "22px",
          "color": "#212121",
          "lineHeight": "135%"
        }
      },
      {
        "id": "paragraph",
        "name": "Paragraph",
        "styles": {
          "fontFamily": "Arial, sans-serif",
          "fontSize": "16px",
          "color": "#212121",
          "lineHeight": "150%"
        }
      },
      {
        "id": "footnote",
        "name": "Footnote",
        "styles": {
          "fontFamily": "Arial, sans-serif",
          "fontSize": "12px",
          "color": "#757575",
          "lineHeight": "150%"
        }
      }
    ]
  },
  "sections": [
    {
      "id": "aaa000000000000000000001",
      "rows": [
        {
          "id": "aaa000000000000000000002",
          "columns": [
            {
              "id": "aaa000000000000000000003",
              "width": "600px",
              "blocks": [
                {
                  "id": "aaa000000000000000000004",
                  "type": "text",
                  "text": "<p style=\"margin-top: 0px; margin-bottom: 0px;\">Hello [[contact.first_name]]!</p>",
                  "styleProperties": {
                    "padding": "16px"
                  },
                  "stylePresetID": "paragraph"
                }
              ]
            }
          ]
        }
      ],
      "styleProperties": {
        "backgroundColor": "#FFFFFF"
      }
    },
    {
      "id": "699d6eaf7169b6c8fc33dcd4",
      "rows": [
        {
          "id": "699d6eaf7169b6c8fc33dcd5",
          "columns": [
            {
              "id": "699d6eaf7169b6c8fc33dcd6",
              "width": "552px",
              "blocks": [
                {
                  "id": "699d6eaf7169b6c8fc33dcd7",
                  "type": "text",
                  "text": "<p style=\"text-align: center; margin: 0px;\"><a href=\"[[preference_link]]\" data-translation-key=\"preference\" target=\"_blank\">Update preferences</a> or <a href=\"[[unsubscribe_link]]\" data-translation-key=\"unsubscribe\" target=\"_blank\">Unsubscribe</a></p>",
                  "styleProperties": {
                    "padding": "12px",
                    "color": "#000000",
                    "linkColor": "#55ADFF"
                  },
                  "stylePresetID": "footnote"
                }
              ]
            }
          ]
        }
      ],
      "styleProperties": {
        "paddingLeft": "24px",
        "paddingRight": "24px",
        "paddingTop": "12px",
        "paddingBottom": "12px",
        "backgroundColor": "#FFFFFF"
      }
    }
  ]
}'

See also