Render
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/renders';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email_design_system_id":1,"brand_profile_id":1,"locale":"en-US","email_content":{"subject":{"conditional_id":1,"inline_conditional":{"default_syntax":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}},"branches":[{"key":"gold_membership","label":"Gold Membership"}],"dynamic_content_profile_syntaxes":{"additionalProperty":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}}}},"branch_content":{"additionalProperty":{"additionalProperty":"My Email Subject in a Specific Locale"}}},"preheader":{"conditional_id":1,"inline_conditional":{"default_syntax":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}},"branches":[{"key":"gold_membership","label":"Gold Membership"}],"dynamic_content_profile_syntaxes":{"additionalProperty":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}}}},"branch_content":{"additionalProperty":{"additionalProperty":"My Email Preheader in a Specific Locale"}}},"container_component_instance":{"id":"bd1c1b82-1a7b-4f0f-b079-30c1d4189bed","name":"My Component","component_name":"Headline","conditional_id":1,"inline_conditional":{"default_syntax":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}},"branches":[{"key":"gold_membership","label":"Gold Membership"}],"dynamic_content_profile_syntaxes":{"additionalProperty":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}}}},"field_values":{"additionalProperty":{"additionalProperty":{"additionalProperty":{"value":"example","link_tracking_parameters":{"additionalProperty":"example"}}}}},"hidden_from_locales":{"additionalProperty":true},"link_tracking_parameters":{"branch_content":{"additionalProperty":{"additionalProperty":{"additionalProperty":"example"}}}}},"component_instances":[{"id":"bd1c1b82-1a7b-4f0f-b079-30c1d4189bed","name":"My Component","component_name":"Headline","conditional_id":1,"inline_conditional":{"default_syntax":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}},"branches":[{"key":"gold_membership","label":"Gold Membership"}],"dynamic_content_profile_syntaxes":{"additionalProperty":{"closing":"{% endif %}","branch_values":{"gold_membership":"{% if membership == \'gold\' %}","silver_membership":"{% elsif membership == \'silver\' %}"}}}},"field_values":{"additionalProperty":{"additionalProperty":{"additionalProperty":{"value":"example","link_tracking_parameters":{"additionalProperty":"example"}}}}},"hidden_from_locales":{"additionalProperty":true},"link_tracking_parameters":{"branch_content":{"additionalProperty":{"additionalProperty":{"additionalProperty":"example"}}}}}],"global_link_tracking_parameters":{"additionalProperty":"example"}}}'};
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/renders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email_design_system_id": 1, "brand_profile_id": 1, "locale": "en-US", "email_content": { "subject": { "conditional_id": 1, "inline_conditional": { "default_syntax": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } }, "branches": [ { "key": "gold_membership", "label": "Gold Membership" } ], "dynamic_content_profile_syntaxes": { "additionalProperty": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } } } }, "branch_content": { "additionalProperty": { "additionalProperty": "My Email Subject in a Specific Locale" } } }, "preheader": { "conditional_id": 1, "inline_conditional": { "default_syntax": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } }, "branches": [ { "key": "gold_membership", "label": "Gold Membership" } ], "dynamic_content_profile_syntaxes": { "additionalProperty": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } } } }, "branch_content": { "additionalProperty": { "additionalProperty": "My Email Preheader in a Specific Locale" } } }, "container_component_instance": { "id": "bd1c1b82-1a7b-4f0f-b079-30c1d4189bed", "name": "My Component", "component_name": "Headline", "conditional_id": 1, "inline_conditional": { "default_syntax": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } }, "branches": [ { "key": "gold_membership", "label": "Gold Membership" } ], "dynamic_content_profile_syntaxes": { "additionalProperty": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } } } }, "field_values": { "additionalProperty": { "additionalProperty": { "additionalProperty": { "value": "example", "link_tracking_parameters": { "additionalProperty": "example" } } } } }, "hidden_from_locales": { "additionalProperty": true }, "link_tracking_parameters": { "branch_content": { "additionalProperty": { "additionalProperty": { "additionalProperty": "example" } } } } }, "component_instances": [ { "id": "bd1c1b82-1a7b-4f0f-b079-30c1d4189bed", "name": "My Component", "component_name": "Headline", "conditional_id": 1, "inline_conditional": { "default_syntax": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } }, "branches": [ { "key": "gold_membership", "label": "Gold Membership" } ], "dynamic_content_profile_syntaxes": { "additionalProperty": { "closing": "{% endif %}", "branch_values": { "gold_membership": "{% if membership == '\''gold'\'' %}", "silver_membership": "{% elsif membership == '\''silver'\'' %}" } } } }, "field_values": { "additionalProperty": { "additionalProperty": { "additionalProperty": { "value": "example", "link_tracking_parameters": { "additionalProperty": "example" } } } } }, "hidden_from_locales": { "additionalProperty": true }, "link_tracking_parameters": { "branch_content": { "additionalProperty": { "additionalProperty": { "additionalProperty": "example" } } } } } ], "global_link_tracking_parameters": { "additionalProperty": "example" } } }'Renders the selected components of an email design system
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Workspace ID
Request Body
Section titled “Request Body”object
ID of the email design system
ID of the brand profile
Locale to render.
Example
en-USobject
object
The ID of a saved conditional applied to this content. When set, inline_conditional must not be set. The content has a separate variant for each branch of the conditional.
A conditional definition owned by a single component instance in an email.
object
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}object
Example
gold_membershipExample
Gold Membershipobject
A per-DynamicContentProfile syntax entry on a Conditional.
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}Content organized by branch key, then by locale code.
object
Localized email subject, keyed by BCP47 locale
object
Example
My Email Subject in a Specific Localeobject
The ID of a saved conditional applied to this content. When set, inline_conditional must not be set. The content has a separate variant for each branch of the conditional.
A conditional definition owned by a single component instance in an email.
object
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}object
Example
gold_membershipExample
Gold Membershipobject
A per-DynamicContentProfile syntax entry on a Conditional.
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}Content organized by branch key, then by locale code.
object
Localized email preheader, keyed by BCP47 locale
object
Example
My Email Preheader in a Specific Localeobject
Example
bd1c1b82-1a7b-4f0f-b079-30c1d4189bedExample
My ComponentThe name of the component definition this instance is based on.
Example
HeadlineThe ID of a saved conditional applied to this component instance. When set, inline_conditional must not be set. The component renders a separate variant for each branch of the conditional.
Example
1A conditional definition owned by a single component instance in an email.
object
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}object
Example
gold_membershipExample
Gold Membershipobject
A per-DynamicContentProfile syntax entry on a Conditional.
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}Field values organized by branch key.
object
Field values organized by locale code.
A map of locale codes to boolean values indicating whether this component instance is hidden for that locale.
object
Example
trueobject
Per-component-instance link tracking parameter values, organized by branch key, then by locale code.
object
object
A map of link tracking parameter names to their values for this component instance.
object
object
Example
bd1c1b82-1a7b-4f0f-b079-30c1d4189bedExample
My ComponentThe name of the component definition this instance is based on.
Example
HeadlineThe ID of a saved conditional applied to this component instance. When set, inline_conditional must not be set. The component renders a separate variant for each branch of the conditional.
Example
1A conditional definition owned by a single component instance in an email.
object
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}object
Example
gold_membershipExample
Gold Membershipobject
A per-DynamicContentProfile syntax entry on a Conditional.
object
The closing syntax tag for the conditional block.
Example
{% endif %}Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.
object
Example
{ "gold_membership": "{% if membership == 'gold' %}", "silver_membership": "{% elsif membership == 'silver' %}"}Field values organized by branch key.
object
Field values organized by locale code.
A map of locale codes to boolean values indicating whether this component instance is hidden for that locale.
object
Example
trueobject
Per-component-instance link tracking parameter values, organized by branch key, then by locale code.
object
object
A map of link tracking parameter names to their values for this component instance.
object
A map of link tracking parameter names to their values for this component instance.
object
Responses
Section titled “ Responses ”Successful
object
The rendered HTML of the email
The rendered subject line of the email
The rendered preheader text of the email
Example
{ "html": "<html><body><h1>Hello, world!</h1></body></html>", "subject": "Hello, world!", "preheader": "Hello, world!"}Unauthorized
object
Example
{ "message": "Record not found", "code": "share_link_expired"}Forbidden
object
Example
{ "message": "Record not found", "code": "share_link_expired"}Not Found
object
Example
{ "message": "Record not found", "code": "share_link_expired"}Unprocessable Entity
object
object
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}