Export

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

Export endpoints are part of the Content Services API. The Content Services API is available on Beefree SDK plans that are Essentials or above.

Overview

The Export category is one of the most common uses of the Content Services API. After creating a design in the no-code builder, end users often need to export and share it. These endpoints let you offer multiple export options—including HTML, plain text, PDF, and image formats—so your users can easily distribute their finished designs.

Available Collection Values for Export Endpoints

The following table lists the collection values available in this category of endpoints, and their corresponding collection options.

Prior to referencing the table, the following example shows how you can replace the {collection} placeholder based on the type of content you'd like to export.

How to Replace the {collection} Placeholder

The following example URL has a {collection} placeholder. This placeholder needs to be filled in with a Collection Option prior to making an API call.

https://api.getbee.io/v1/{collection}/html

As an example, if you'd like to export an email's HTML using this endpoint, replace {collection} with message.

The final URL to make the API call will be:

https://api.getbee.io/v1/message/html

The following table provides a comprehensive reference of all available options based on what you'd like to export.

Resource
Collection Options

/html

  • /message

  • /page

  • /popup

  • /amp

/plain-text

  • /message

/pdf

  • /message

  • /page

/image

  • /message

  • /page

HTML

URL: https://api.getbee.io/v1/{collection}/html

This endpoint allows you to retrieve the full or partial HTML output of a template (email, page, or popup).

Important: collection is a placeholder within the URL. This placeholder can be replaced with any of the collection options available for the HTML resource. Reference the Export Resource and Collection Options table for a list of available option.

How It Works

To generate HTML from a template's JSON:

  1. Capture or store the latest JSON output from the builder using callbacks such as onChange or autosave.

  2. Send this JSON payload to the HTML endpoint.

  3. Receive the HTML string as the response.

Required Request Payload

  • page (object, required): The full template structure in Beefree JSON format. This is the same structure returned by the builder or captured from its callbacks.

Notes

  • This endpoint bypasses the need for the onSave callback and can be used at any time post-editing.

  • Partial HTML rendering is also supported for specific components or modules (if required by your use case).

  • The output HTML reflects the current rendering engine used by Beefree, ensuring up-to-date compatibility.

Transform Beefree JSON into HTML

post

Use this endpoint to transform any template's Beefree JSON into HTML. This endpoint is compatible with Email, Page, and Popup builder designs.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
collectionstringRequired

The collection ID or name

Body
commentsobjectOptional

An object field for comments

beautifyHtmlEnabledintegerOptional

An integer field for beautifyHtmlEnabled

Responses
200

Successful response

text/html
Responsestring
post
/v1/{collection}/html

Plain Text

URL: https://api.getbee.io/v1/{collection}/html

This endpoint allows you to retrieve the plain text version of an email.

Important: collection is a placeholder within the URL. This placeholder can be replaces with any of the collection options available for the Plain Text resource. Reference the Export Resource and Collection Options table for a list of available option.

How It Works

To generate plain text from a template's JSON:

  1. Capture or store the latest JSON output from the builder using callbacks such as onChange or autosave.

  2. Send this JSON payload to the /plain-text endpoint.

  3. Receive the plain text as the response.

Transform Beefree JSON into Plain Text

post

Use this endpoint to transform any template's Beefree JSON into HTML. This endpoint is compatible with Email builder designs.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
collectionstringRequired

The collection ID or name

Body
languagestringOptional

A string field for language

Responses
200

Successful response

text/plain
Responsestring
post
/v1/{collection}/plain-text

PDF

URL: https://api.getbee.io/v1/{collection}/pdf

You can generate a PDF file from valid HTML content using the dedicated PDF generation endpoint. This operation requires a JSON payload with specific fields to configure the output.

Important: collection is a placeholder within the URL. This placeholder can be replaces with any of the collection options available for the PDF resource. Reference the Export Resource and Collection Options table for a list of available option.

Required Request Payload

Field Descriptions

  • html (string, required): The full HTML content to convert to a PDF. You can obtain the HTML output of a template by calling the /html endpoint and copying its response into this field.

  • page_orientation (string, required): Sets the orientation of the generated PDF pages. Accepted values:

    • "portrait": vertical layout.

    • "landscape": horizontal layout.

  • page_size (string, required): Defines the dimensions of the PDF output. Accepted values:

    • "Letter": US Letter format.

    • "A4": A4 paper size.

    • "A3": A3 paper size.

    • "Full": a single continuous page with fixed width (900px) and height determined proportionally to the content.

Steps to generate a PDF

To generate a PDF from a template:

  1. Call the /html endpoint to retrieve the template's HTML.

  2. Insert that HTML into the "html" field of the request payload.

  3. Set your preferred "page_orientation" and "page_size".

  4. Send the payload to the PDF generation endpoint.

Transform HTML into a PDF

post

Transform email or page HTML into a PDF that can be attached to emails, SMS messages, or physically printed out.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
collectionstringRequired

The collection ID or name

Body
page_sizestringOptional

A string field for page_size

page_orientationstringOptional

A string field for page_orientation

htmlstringOptional

A string field for html

Responses
200

Successful response

application/json
Responseobject
post
/v1/{collection}/pdf

Note: The response is a JSON string that will contain the URL of the temporary location of the PDF document. The file is available for 24 hours.

Image

URL: https://api.getbee.io/v1/{collection}/image

This endpoint allows you to generate an image file (for example, PNG) from a template's HTML. You can control the image output by specifying the dimensions.

Important: collection is a placeholder within the URL. This placeholder can be replaces with any of the collection options available for the Image resource. Reference the Export Resource and Collection Options table for a list of available option.

Required Request Payload

Note: As an alternative to providing width and height, you can also provide size.

Rendering

The HTML is rendered using a fixed-size browser window to simulate a real-world preview. Here are the key rendering parameters:

  • Window Size: 1920 x 1080 pixels (used for clipping/screenshot area)

  • Default Viewports:

    • Mobile: 320px width

    • Desktop: 1024px width

  • Clipping Region: defaults to 1920 x 1080 pixels

  • Scale Factor: Automatically calculated to match viewport and clipping dimensions.

You may override the clipping size if your layout requires a custom viewport. If your content exceeds the clipping area, it may be cropped. For improved results, using auto height with the size parameter is recommended.

Steps to perform an Image API call

  1. Use the /html endpoint to generate the HTML version of your template.

  2. Set the html field in your image request payload to the HTML generated.

  3. Provide a width and height values, or a size value.

  4. Send the payload to the image endpoint.

Name
Type
Description

html*

String

A Beefree HTML message.

size

String

Use “size” instead of “width” and “height” when you only know the width and want the height automatically calculated. Required if width and height are not defined.

width

Integer

The image width in pixels. Required if size is not defined.

height

Integer

The image height in pixels. Default applies a proportional value based on the given width, keeping the image aspect ratio. When the value is not proportional to the given width, either will occur: If it’s higher, the proportional value applies, or, if it’s lower, the image is cropped. Required if size is not defined.

file_type*

String

Accepts jpg or png.

Transform HTML into an Image

post

Use this endpoint to transform a design's HTML into an Image, which can be used for thumbnails and similar purposes. Compatible with Email and Page builder.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
collectionstringRequired

The collection ID or name

Body
file_typestringRequired

A string field for file_type

sizestringRequired

A string field for size

htmlstringRequired

A string field for html

Responses
200

Successful response

image/png
Responsestring · binary
post
/v1/{collection}/image

Last updated

Was this helpful?