Convert

This page lists and describes the Convert category of endpoints within the Content Services API. It also includes interactive testing environments for each endpoint in this category.

Conversion Collection

The Conversion Collection provides you with endpoints that enable you to convert templates from one format to another. With the Email to Page endpoint, you can easily convert your email JSON templates into page JSON. The Page to Email endpoint lets you turn your page JSON templates into email-ready JSON, with the option to disable the HTML sanitizer if needed. The Simple to Full JSON endpoint enables you to convert Simple Schema templates into full Beefree JSON templates that can be loaded in the builder.

Important: For all endpoints in this category, the value for collection is conversion. When making API calls, replace the collection placeholder within the URL with conversion to execute the call.

Email to Page Conversion: Important Behaviors

The Email to Page endpoint converts a JSON template created for email into a JSON template optimized for web pages. During this conversion, the following adjustments are applied:

  • Remove AMP Carousel Any AMP carousels included in the email template are removed, as these are not supported in the page format.

  • Expand Content Area Width The content width is expanded to 900px to fit the web page format, removing the width constraints typically applied to emails.

  • Target Attributes Target attributes will not be processed. Remove all link target attributes or set them to "Open a new page." Links will not be modified during the conversion.

  • Remove Subject and Preheader Email-specific metadata, such as the subject line and preheader text, is removed since these elements are not relevant in the page format.

  • Retain Comments and Secondary Language Comments and secondary language data in the email template are preserved in the conversion process.

Convert Email JSON to Page JSON

post

Convert an email JSON template to a page JSON template, and ensure compatibility throughout the conversion process by removing or adjusting unsupported blocks.

Authorizations
Path parameters
collectionstringRequired

The collection ID or name

Body
Responses
200
Successful response
application/json
Responseobject
post
POST /v1/{collection}/email-to-page HTTP/1.1
Host: api.getbee.io
Authorization: Bearer Enter Dev Console API Key as Bearer token
Content-Type: application/json
Accept: */*
Content-Length: 3810

{
  "template": {
    "page": {
      "body": {
        "container": {
          "style": {
            "background-color": "#FFFFFF"
          }
        },
        "content": {
          "computedStyle": {
            "linkColor": "#0068A5",
            "messageBackgroundColor": "transparent",
            "messageWidth": "500px"
          },
          "style": {
            "color": "#000000",
            "font-family": "Arial, Helvetica, sans-serif"
          }
        },
        "type": "mailup-bee-page-properties",
        "webFonts": []
      },
      "description": "Empty template for BEE",
      "rows": [
        {
          "columns": [
            {
              "grid-columns": 12,
              "modules": [
                {
                  "type": "mailup-bee-newsletter-modules-paragraph",
                  "descriptor": {
                    "paragraph": {
                      "html": "<p>I'm a new paragraph block.</p>",
                      "style": {
                        "color": "#000000",
                        "font-size": "14px",
                        "font-family": "inherit",
                        "font-weight": "400",
                        "line-height": "120%",
                        "text-align": "left",
                        "direction": "ltr",
                        "letter-spacing": "0px"
                      },
                      "computedStyle": {
                        "linkColor": "#0068A5",
                        "paragraphSpacing": "16px"
                      }
                    },
                    "style": {
                      "padding-top": "10px",
                      "padding-right": "10px",
                      "padding-bottom": "10px",
                      "padding-left": "10px"
                    },
                    "mobileStyle": {},
                    "computedStyle": {
                      "hideContentOnAmp": false,
                      "hideContentOnHtml": false,
                      "hideContentOnDesktop": false,
                      "hideContentOnMobile": false
                    }
                  },
                  "uuid": "c8ecedba-4891-46fa-9aec-1f4ef3276914",
                  "locked": false
                },
                {
                  "type": "mailup-bee-newsletter-modules-image",
                  "descriptor": {
                    "image": {
                      "alt": "",
                      "src": "https://d153pg9b3vec03.cloudfront.net/public/users/Integrators/41032f14-a2c0-4389-842f-81e67db90a66/Marco/download.png",
                      "href": "",
                      "target": "_blank",
                      "width": "110px",
                      "height": "110px"
                    },
                    "style": {
                      "width": "100%",
                      "border-radius": "0px",
                      "padding-top": "0px",
                      "padding-right": "0px",
                      "padding-bottom": "0px",
                      "padding-left": "0px"
                    },
                    "computedStyle": {
                      "class": "center autowidth",
                      "width": "110px",
                      "hideContentOnMobile": false
                    },
                    "mobileStyle": {}
                  },
                  "uuid": "bf5b394e-e238-40cf-9c45-69866139490c",
                  "locked": false
                },
                {
                  "type": "mailup-bee-newsletter-modules-table",
                  "descriptor": {
                    "table": {
                      "content": {
                        "headers": [
                          {
                            "cells": [
                              {
                                "html": "a"
                              },
                              {
                                "html": "a"
                              },
                              {
                                "html": "a"
                              }
                            ]
                          }
                        ],
                        "rows": [
                          {
                            "cells": [
                              {
                                "html": "Add text"
                              },
                              {
                                "html": ""
                              },
                              {
                                "html": ""
                              }
                            ]
                          },
                          {
                            "cells": [
                              {
                                "html": ""
                              },
                              {
                                "html": ""
                              },
                              {
                                "html": ""
                              }
                            ]
                          },
                          {
                            "cells": [
                              {
                                "html": ""
                              },
                              {
                                "html": ""
                              },
                              {
                                "html": ""
                              }
                            ]
                          }
                        ]
                      },
                      "style": {
                        "color": "#000000",
                        "font-size": "14px",
                        "font-family": "inherit",
                        "font-weight": "400",
                        "line-height": "120%",
                        "text-align": "left",
                        "direction": "ltr",
                        "letter-spacing": "0px",
                        "background-color": "transparent",
                        "border-top": "1px solid #dddddd",
                        "border-right": "1px solid #dddddd",
                        "border-bottom": "1px solid #dddddd",
                        "border-left": "1px solid #dddddd"
                      },
                      "computedStyle": {
                        "linkColor": "#0068A5",
                        "headersFontSize": "14px",
                        "headersFontWeight": "400",
                        "headersTextAlign": "left",
                        "headersBackgroundColor": "#EAEAEA",
                        "headersColor": "#505659"
                      }
                    },
                    "style": {
                      "padding-top": "10px",
                      "padding-right": "10px",
                      "padding-bottom": "10px",
                      "padding-left": "10px"
                    },
                    "mobileStyle": {},
                    "computedStyle": {
                      "hideContentOnAmp": false,
                      "hideContentOnHtml": false,
                      "hideContentOnDesktop": false,
                      "hideContentOnMobile": false
                    }
                  },
                  "uuid": "77957748-6069-40bd-9342-14f0b514f244",
                  "locked": false
                }
              ],
              "style": {
                "background-color": "transparent",
                "border-bottom": "0px solid transparent",
                "border-left": "0px solid transparent",
                "border-right": "0px solid transparent",
                "border-top": "0px solid transparent",
                "padding-bottom": "5px",
                "padding-left": "0px",
                "padding-right": "0px",
                "padding-top": "5px"
              },
              "uuid": "9cb47b70-8e2f-4e12-b79b-511f3c7b0dae"
            }
          ],
          "container": {
            "style": {
              "background-color": "transparent",
              "background-image": "none",
              "background-position": "top left",
              "background-repeat": "no-repeat"
            }
          },
          "content": {
            "computedStyle": {
              "hideContentOnDesktop": false,
              "hideContentOnMobile": false,
              "rowColStackOnMobile": true,
              "rowReverseColStackOnMobile": false,
              "verticalAlign": "top"
            },
            "style": {
              "background-color": "transparent",
              "background-image": "none",
              "background-position": "top left",
              "background-repeat": "no-repeat",
              "color": "#000000",
              "width": "500px"
            }
          },
          "empty": false,
          "locked": false,
          "synced": false,
          "type": "row-1-columns-12",
          "uuid": "ae43b807-1a9d-4f1f-888d-798f74ec54b3"
        }
      ],
      "template": {
        "name": "template-base",
        "type": "basic",
        "version": "2.0.0"
      },
      "title": "Empty Template"
    }
  }
}
{
  "message": "Success"
}

Page to Email Conversion: Important Behaviors

The Page to Email endpoint transforms a JSON template designed for a web page into a JSON template optimized for email. During this conversion process, the following adjustments are made:

  • Remove Video Row Backgrounds Video backgrounds applied to page rows are removed because email formats do not support video backgrounds.

  • Replace Embedded Videos with Thumbnails Embedded videos are replaced with thumbnail images. This ensures recipients can preview the content visually without the compatibility issues of embedded videos. Note: Hosted videos will not be converted.

  • Remove Form Blocks Any form blocks present in the page template are removed.

  • Adjust Design Content Area Width If the page width exceeds the maximum width supported by the email builder (900px), it is resized to fit within email constraints.

  • Update Link Target Attributes Target attributes will not be processed. Remove all link target attributes. Links will not be modified during the conversion.

  • Sanitize Code The endpoint sanitizes the code to ensure compatibility with email standards. When the sanitizer is disabled, the payload looks like this:

    {
      "disableHtmlSanitizer": true,
      "template": { "page": ... }
    }
  • Handle Multi-Column Layouts The email builder supports up to 12 columns, which is compatible with the page builder's column configurations.

Convert Page JSON to Email JSON

post

Convert a page JSON template to an email JSON template, and ensure compatibility throughout the conversion process by removing or adjusting unsupported blocks.

Authorizations
Path parameters
collectionstringRequired

The collection ID or name

Body
disableHtmlSanitizerintegerOptional

An integer field for disableHtmlSanitizer

Responses
200
Successful response
application/json
Responseobject
post
POST /v1/{collection}/page-to-email HTTP/1.1
Host: api.getbee.io
Authorization: Bearer Enter Dev Console API Key as Bearer token
Content-Type: application/json
Accept: */*
Content-Length: 2705

{
  "disableHtmlSanitizer": true,
  "template": {
    "page": {
      "body": {
        "container": {
          "style": {
            "background-color": "#FFFFFF"
          }
        },
        "content": {
          "computedStyle": {
            "linkColor": "#0068A5",
            "messageBackgroundColor": "transparent",
            "messageWidth": "500px"
          },
          "style": {
            "color": "#000000",
            "font-family": "Arial, Helvetica, sans-serif"
          }
        },
        "type": "mailup-bee-page-properties",
        "webFonts": []
      },
      "description": "Empty template for BEE",
      "rows": [
        {
          "columns": [
            {
              "grid-columns": 12,
              "modules": [
                {
                  "type": "mailup-bee-newsletter-modules-html",
                  "descriptor": {
                    "html": {
                      "html": "<div class=\"our-class\"><script>console.log(\"ok\");</script>test 1</div>"
                    },
                    "style": {
                      "padding-top": "0px",
                      "padding-right": "0px",
                      "padding-bottom": "0px",
                      "padding-left": "0px"
                    },
                    "computedStyle": {
                      "hideContentOnMobile": false,
                      "hideContentOnDesktop": false,
                      "hideContentOnAmp": false,
                      "hideContentOnHtml": false
                    }
                  },
                  "uuid": "f6c6a079-dd90-4589-8855-93dfdf74461d",
                  "locked": false
                }
              ],
              "style": {
                "background-color": "transparent",
                "border-bottom": "0px solid transparent",
                "border-left": "0px solid transparent",
                "border-right": "0px solid transparent",
                "border-top": "0px solid transparent",
                "padding-bottom": "5px",
                "padding-left": "0px",
                "padding-right": "0px",
                "padding-top": "5px"
              },
              "uuid": "cbd74fa2-b853-449e-88b8-f34195441c05"
            },
            {
              "grid-columns": 12,
              "modules": [
                {
                  "type": "mailup-bee-newsletter-modules-html",
                  "descriptor": {
                    "html": {
                      "html": "<div class=\"our-class\"><script>console.log(\"ok\");</script>test 2</div>"
                    },
                    "style": {
                      "padding-top": "0px",
                      "padding-right": "0px",
                      "padding-bottom": "0px",
                      "padding-left": "0px"
                    },
                    "computedStyle": {
                      "hideContentOnMobile": false,
                      "hideContentOnDesktop": false,
                      "hideContentOnAmp": false,
                      "hideContentOnHtml": false
                    }
                  },
                  "uuid": "f6c6a079-dd90-4589-8855-93dfdf74461d",
                  "locked": false
                }
              ],
              "style": {
                "background-color": "transparent",
                "border-bottom": "0px solid transparent",
                "border-left": "0px solid transparent",
                "border-right": "0px solid transparent",
                "border-top": "0px solid transparent",
                "padding-bottom": "5px",
                "padding-left": "0px",
                "padding-right": "0px",
                "padding-top": "5px"
              },
              "uuid": "cbd74fa2-b853-449e-88b8-f34195441c05"
            }
          ],
          "container": {
            "style": {
              "background-color": "transparent",
              "background-image": "none",
              "background-position": "top left",
              "background-repeat": "no-repeat"
            }
          },
          "content": {
            "computedStyle": {
              "hideContentOnDesktop": false,
              "hideContentOnMobile": false,
              "rowColStackOnMobile": true,
              "rowReverseColStackOnMobile": false,
              "verticalAlign": "top"
            },
            "style": {
              "background-color": "transparent",
              "background-image": "none",
              "background-position": "top left",
              "background-repeat": "no-repeat",
              "color": "#000000",
              "width": "500px"
            }
          },
          "empty": false,
          "locked": false,
          "synced": false,
          "type": "row-1-columns-12",
          "uuid": "d0a914f7-7212-41c6-9372-c954886e6bd4"
        }
      ],
      "template": {
        "name": "template-base",
        "type": "basic",
        "version": "2.0.0"
      },
      "title": "Empty Template"
    }
  }
}
{
  "message": "Success"
}

Simple to Full JSON

Simple Schema is available on Superpowers and Enterprise plans.

This section discusses what the /simple-to-full-json endpoint is and how you can use it for AI-driven designs. Beefree SDK template JSON is long and includes many properties. For this reason, it does not provide the best structure for training AI models in workflows that include AI-driven design creation. Beefree SDK's Simple schema is a lightweight alternative that is optimized for training AI models. Simple schema, which is several lines shorter than Beefree SDK's template JSON, is a great solution for AI-generated schemas. This endpoint accepts Simple schema as the body of the POST request, and returns the full Beefree SDK template JSON, which can then be loaded in the Beefree SDK editor for an end user to view and edit accordingly. There are many creative ways to use and implement this endpoint, because it provides a pathway to programmatically creating full Beefree SDK-compatible templates completely outside of the Beefree SDK builder.

Request Parameters

The API call accepts a template object, which is required to successfully perform the /simple-to-full-json API call. The following table describes this required object.

Name
Type
Required
Description

template

JSON

Yes

A Beefree SDK template in simple JSON format (see the schema in GitHub).

The following code snippet shows the template object as the body of the POST request.

{
  “template”:{...}
}

Note: The simple template JSON schema describes the request parameters, and the template object structure.

Object Parameters Nested within the Template Object

The following table lists and describes both required and optional object parameters nested within the mandatory template object. This template object is the body of the POST request for the API call.

Name
Type
Required
Description

type

String

✅ Yes

Specifies the template type. Possible values include: email, page, popup.

rows

Array

✅ Yes

Array containing at least one row. Reference the simple row schema.

settings

Object

❌ No

Configuration settings. Reference the Settings Object Parameters section for more information.

metadata

Object

❌ No

Metadata information. Reference the Metadata Object Parameters section for more information.

Settings Object Parameters

The following code snippet shows the optional settings object nested within the template object in the body of the POST request.

{
  “template”:{
    "settings":{...},
    ...
  }
}

The following table lists and describes optional object parameters nested within the settings object. The settings object is nested within the mandatory template object.

Name
Type
Required
Description

linkColor

String

❌ No

The default color of the links within the template.

backgroundColor

String

❌ No

The background color of the template.

contentAreaBackgroundColor

String

❌ No

The background color of the content area.

width

integer

❌ No

Important: The width of the template must be between 320 and 1440 pixels.

Metadata Object Parameters

The following code snippet shows the optional metadata object nested within the template object in the body of the POST request.

{
  “template”:{
    "metadata":{...},
    ...
  }
}

The following table lists and describes optional object parameters nested within the metadata object. The metadata object is nested within the mandatory template object.

Name
Type
Required
Description

lang

string

❌ No

The language code of the template (for example, "en", "fr").

title

string

❌ No

The title of the template.

description

string

❌ No

A short description of the template.

subject

string

❌ No

The subject line of the email (if applicable).

preheader

string

❌ No

The preheader text for the email (if applicable).

Last updated

Was this helpful?