Create Editor Operations
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1/editor_operations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"operations":[{"type":"add_component_instance","data":{"new_component_instance":{"id":"bd1c1b82-1a7b-4f0f-b079-30c1d4189bed","name":"My Component","component_name":"Headline","conditional_id":1,"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"}}}}},"insert_after_component_instance_id":"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/emails/1/editor_operations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "operations": [ { "type": "add_component_instance", "data": { "new_component_instance": { "id": "bd1c1b82-1a7b-4f0f-b079-30c1d4189bed", "name": "My Component", "component_name": "Headline", "conditional_id": 1, "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" } } } } }, "insert_after_component_instance_id": "example" } } ] }'Creates a new editor operations.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID
Email ID
Request Body
Section titled “Request Body”object
object
object
object
Example
bd1c1b82-1a7b-4f0f-b079-30c1d4189bedExample
My ComponentThe name of the component definition this instance is based on.
Example
HeadlineThe ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.
Example
1Field 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
object
object
object
Example
en-USobject
object
object
Example
en-USobject
object
Example
en-USobject
object
object
object
object
object
Example
en-USobject
object
object
object
Example
en-USobject
object
Example
en-USobject
object
object
object
object
object
object
object
object
object
Responses
Section titled “Responses”Successful
object
object
object
object
The ID of the conditional applied to this content. When set, the content has a separate variant for each branch of the conditional.
Content organized by branch key, then by locale code.
object
Localized email subject, keyed by BCP47 locale
object
object
The ID of the conditional applied to this content. When set, the content has a separate variant for each branch of the conditional.
Content organized by branch key, then by locale code.
object
Localized email preheader, keyed by BCP47 locale
object
object
The name of the component definition this instance is based on.
The ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.
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
object
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
The name of the component definition this instance is based on.
The ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.
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
object
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
Example
{ "email": { "id": 12345, "status": "draft", "name": "My Email", "project_id": 12345, "created_at": "2023-08-23T10:30:00.000Z", "organization_id": 12345, "email_design_system_id": 12345, "default_locale": "ar-SA", "locales": [ "ar-SA" ], "updated_at": "2023-08-23T10:30:00.000Z", "last_updated_by": { "type": "User", "id": 12345, "first_name": "John", "last_name": "Smith", "profile_image_url": "https://example.com/profile.jpg" }, "ai_edit_in_progress": false, "ai_agent_id": 12345, "brand_profile_id": 12345, "link_tracking_profile_id": 12345, "published_at": "2023-08-23T10:30:00.000Z", "screenshot_url": "https://www.example.com/screenshot.png" }, "email_content": { "subject": { "branch_content": { "additionalProperty": { "additionalProperty": "My Email Subject in a Specific Locale" } } }, "preheader": { "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, "hidden_from_locales": { "additionalProperty": true } }, "component_instances": [ { "id": "bd1c1b82-1a7b-4f0f-b079-30c1d4189bed", "name": "My Component", "component_name": "Headline", "conditional_id": 1, "hidden_from_locales": { "additionalProperty": true } } ] }}Unauthorized
object
Example
{ "message": "Record not found"}Forbidden
object
Example
{ "message": "Record not found"}Unprocessable Entity
object
object
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}