Skip to content

Create Export

POST
/api/v1/workspaces/{workspace_id}/exports
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.

workspace_id
required
integer

Workspace ID

Media typeapplication/json
object
connector_id

The ID of the Connector to export to. Required when export_type is ‘connector’.

integer
Example
1
email_id
required

The ID of the Email to export. The email must be published.

integer
Example
1
export_type
required
string
Allowed values: html connector json
dynamic_content_profile_id

The 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.

string
Example
1
image_mode

How 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.
string
Allowed values: use_cdn include_in_zip use_cdn_connector use_export_connector
minify_html

Minify the rendered HTML before saving the export output.

boolean
folder_id

Connector exports only. The folder to create resources in, for integrations with folder_support. Does not apply to resources being overwritten.

string
campaign_id

Connector exports only. The campaign to export to, for integrations with campaign_selection_required.

string
export_field_values

Connector exports only. Values for the integration’s export_fields, keyed by field name.

object
key
additional properties
string
outputs
required

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.

Array<object>
object
locale
required

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.

string
Example
en-GB
name

Connector exports only. Create a new resource with this name.

string
Example
Spring Sale (EN)
external_id

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.

string
Example
tpl_456
cdn_connector_id

The ID of the CDN Connector to host images on. Required when image_mode is ‘use_cdn_connector’.

integer
Example
1

Successful

Media typeapplication/json
object
id
required
integer
organization_id
required
integer
connector_id
required
integer | null
cdn_connector_id
required
integer | null
email_id
required
integer
email
required
object
id
integer
name
string
dynamic_content_profile_id
required
string | null
status
required
string
Allowed values: in_progress completed failed
export_type
required
string
Allowed values: json html connector
image_mode
required
string
Allowed values: use_cdn include_in_zip use_cdn_connector use_export_connector
minify_html
required
boolean
folder_id
required
string | null
campaign_id
required
string | null
export_field_values
required
object | null
outputs
required

One entry per exported locale. For connector exports, the resource created or overwritten in the connector.

Array<object>
object
locale
required

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.

string
name
required

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.

string | null
external_id
required

The ID of the resource in the connector. Null for html and json exports, and until a connector export completes.

string | null
url
required

A link to open the resource in the connector. Null for html and json exports, and until a connector export completes.

string | null
integration_name
required
string | null
metadata
required
object
conditional_ids
Array<integer>
personalization_tag_ids
Array<integer>
image_ids
Array<integer>
export_errors
required
object
base
Array<string> | null
additionalProperties
object
key
additional properties
Array<string>
created_at
required
string format: date-time
updated_at
required
string format: date-time
download_zip_url
required

Set once an html export completes.

string | null
download_json_url
required

Set once a json export completes.

string | null
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

Media typeapplication/json
object
message
required
string
Example
{
"message": "Record not found"
}

Forbidden

Media typeapplication/json
object
message
required
string
Example
{
"message": "Record not found"
}

Not Found

Media typeapplication/json
object
message
required
string
Example
{
"message": "Record not found"
}

Unprocessable Entity

Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{
"errors": {
"username": [
"Username is required.",
"Username must be unique."
],
"email": [
"Invalid email format."
]
}
}