Create Export
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/exports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"connector_id":1,"email_id":1,"export_type":"html","dynamic_content_profile_id":"1","image_mode":"use_cdn","minify_html":true,"folder_id":"example","campaign_id":"example","export_field_values":{"additionalProperty":"example"},"outputs":[{"locale":"en-GB","name":"Spring Sale (EN)","external_id":"tpl_456"}],"cdn_connector_id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/exports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "connector_id": 1, "email_id": 1, "export_type": "html", "dynamic_content_profile_id": "1", "image_mode": "use_cdn", "minify_html": true, "folder_id": "example", "campaign_id": "example", "export_field_values": { "additionalProperty": "example" }, "outputs": [ { "locale": "en-GB", "name": "Spring Sale (EN)", "external_id": "tpl_456" } ], "cdn_connector_id": 1 }'Creates a new export.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID
Request Body
Section titled “Request Body”object
The ID of the Connector to export to. Required when export_type is ‘connector’.
Example
1The ID of the Email to export. The email must be published.
Example
1The ID of the Dynamic Content Profile to use when rendering the export. If omitted, dynamic content is resolved with default values. Ignored when the connector enforces a profile, which is always used.
Example
1How images from the image library are hosted in the output. Images entered as URLs are left untouched.
use_cdn(default): host on the EmailShepherd CDN.include_in_zip: html exports only, bundle into the zip.use_cdn_connector: upload to the CDN connector given by cdn_connector_id.use_export_connector: upload to the export connector. Applied automatically when the connector’s export_images setting is on.
Minify the rendered HTML before saving the export output.
Connector exports only. The folder to create resources in, for integrations with folder_support. Does not apply to resources being overwritten.
Connector exports only. The campaign to export to, for integrations with campaign_selection_required.
Connector exports only. Values for the integration’s export_fields, keyed by field name.
object
One entry per locale to export. For connector exports each entry needs either a name, to create a new resource, or an external_id, to overwrite an existing one.
object
A BCP 47 language tag identifying the language and region of a piece of content. Must carry both a language and a region subtag, and must be in canonical case (lowercase language, titlecase script, uppercase region) — en-GB, not en-gb or en_GB. The region may be a UN M.49 code, so en-001 (world) is valid.
Example
en-GBConnector exports only. Create a new resource with this name.
Example
Spring Sale (EN)Connector exports only. Overwrite this existing resource in the connector. List existing resources with the connector resources endpoint, or read external_id from the outputs of a previous export.
Example
tpl_456The ID of the CDN Connector to host images on. Required when image_mode is ‘use_cdn_connector’.
Example
1Responses
Section titled “Responses”Successful
object
object
One entry per exported locale. For connector exports, the resource created or overwritten in the connector.
object
A BCP 47 language tag identifying the language and region of a piece of content. Must carry both a language and a region subtag, and must be in canonical case (lowercase language, titlecase script, uppercase region) — en-GB, not en-gb or en_GB. The region may be a UN M.49 code, so en-001 (world) is valid.
The name of the output. For connector exports, the name of the resource in the connector. Null for a resource being overwritten until the export completes.
The ID of the resource in the connector. Null for html and json exports, and until a connector export completes.
A link to open the resource in the connector. Null for html and json exports, and until a connector export completes.
object
object
object
Set once an html export completes.
Set once a json export completes.
Example
{ "id": 12345, "organization_id": 12345, "connector_id": 12345, "cdn_connector_id": 12345, "email_id": 12345, "email": { "id": 12345 }, "dynamic_content_profile_id": "a8c5c5c0-5b1a-4b5a-9b0a-5e8b5c5c5c5c", "status": "in_progress", "export_type": "json", "image_mode": "use_cdn", "outputs": [ { "locale": "en-GB", "name": "Spring Sale (EN)", "external_id": "tpl_456", "url": "https://dashboard.braze.com/engagement/templates/tpl_456" } ], "integration_name": "Brevo", "metadata": { "conditional_ids": [ 12345 ], "personalization_tag_ids": [ 12345 ], "image_ids": [ 12345 ] }, "export_errors": { "base": [ "My Error" ], "additionalProperties": { "additionalProperty": [ "My Error" ] } }, "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z", "download_zip_url": "https://www.example.com/download.zip", "download_json_url": "https://www.example.com/download.json"}Unauthorized
object
Example
{ "message": "Record not found"}Forbidden
object
Example
{ "message": "Record not found"}Not Found
object
Example
{ "message": "Record not found"}Unprocessable Entity
object
object
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}