Skip to content

Create Editor Operations

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

workspace_id
required
integer

Workspace ID

email_id
required
integer

Email ID

Media typeapplication/json
object
operations
required
Array
One of:
object
type
required
string
Allowed values: add_component_instance
data
required
object
new_component_instance
required
object
id
required
string
Example
bd1c1b82-1a7b-4f0f-b079-30c1d4189bed
name
string
Example
My Component
component_name
required

The name of the component definition this instance is based on.

string
Example
Headline
conditional_id

The ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.

integer
nullable
Example
1
field_values

Field values organized by branch key.

object
key
additional properties

Field values organized by locale code.

object
key
additional properties

Field values keyed by liquid variable name.

object
key
additional properties
object
value
required
One of:
string
link_tracking_parameters

Link tracking parameter values specific to this field.

object
key
additional properties
string
hidden_from_locales

A map of locale codes to boolean values indicating whether this component instance is hidden for that locale.

object
key
additional properties
boolean
Example
true
link_tracking_parameters
object
branch_content

Per-component-instance link tracking parameter values, organized by branch key, then by locale code.

object
key
additional properties
object
key
additional properties

A map of link tracking parameter names to their values for this component instance.

object
key
additional properties
string
insert_after_component_instance_id
required
string
nullable

Successful

Media typeapplication/json
object
email
required
object
id
required
integer
status
required
string
Allowed values: draft in_review changes_requested approved published
name
required
string
project_id
required
integer
created_at
required
string format: date-time
organization_id
required
integer
email_design_system_id
required
integer
default_locale
required
string
Allowed values: ar-SA bn-BD bn-IN ca-ES cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT ja-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK
locales
required
Array<string>
Allowed values: ar-SA bn-BD bn-IN ca-ES cs-CZ da-DK de-AT de-CH de-DE el-GR en-AU en-CA en-GB en-IE en-IN en-NZ en-US en-ZA es-AR es-CL es-CO es-ES es-MX es-US fi-FI fr-BE fr-CA fr-CH fr-FR he-IL hi-IN hu-HU id-ID it-CH it-IT ja-JP ko-KR nl-BE nl-NL no-NO pl-PL pt-BR pt-PT ro-RO ru-RU sk-SK sv-SE ta-IN ta-LK th-TH tr-TR zh-CN zh-HK
updated_at
required
string format: date-time
last_updated_by
required
object
One of:
object
type
required
string
Allowed values: User
id
required
integer
first_name
required
string
last_name
required
string
profile_image_url
required
string
nullable
ai_edit_in_progress
required
boolean
ai_agent_id
required
integer
nullable
brand_profile_id
required
integer
nullable
link_tracking_profile_id
required
integer
nullable
published_at
required
string format: date-time
nullable
screenshot_url
required
string
email_content
required
object
subject
required
object
conditional_id

The ID of the conditional applied to this content. When set, the content has a separate variant for each branch of the conditional.

integer
nullable
branch_content
required

Content organized by branch key, then by locale code.

object
key
additional properties

Localized email subject, keyed by BCP47 locale

object
key
additional properties
string
preheader
required
object
conditional_id

The ID of the conditional applied to this content. When set, the content has a separate variant for each branch of the conditional.

integer
nullable
branch_content
required

Content organized by branch key, then by locale code.

object
key
additional properties

Localized email preheader, keyed by BCP47 locale

object
key
additional properties
string
container_component_instance
required
object
id
required
string
name
string
component_name
required

The name of the component definition this instance is based on.

string
conditional_id

The ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.

integer
nullable
field_values

Field values organized by branch key.

object
key
additional properties

Field values organized by locale code.

object
key
additional properties

Field values keyed by liquid variable name.

object
key
additional properties
object
value
required
One of:
string
link_tracking_parameters

Link tracking parameter values specific to this field.

object
key
additional properties
string
hidden_from_locales

A map of locale codes to boolean values indicating whether this component instance is hidden for that locale.

object
key
additional properties
boolean
link_tracking_parameters
object
branch_content

Per-component-instance link tracking parameter values, organized by branch key, then by locale code.

object
key
additional properties
object
key
additional properties

A map of link tracking parameter names to their values for this component instance.

object
key
additional properties
string
component_instances
required
Array<object>
object
id
required
string
name
string
component_name
required

The name of the component definition this instance is based on.

string
conditional_id

The ID of the conditional applied to this component instance. When set, the component renders a separate variant for each branch of the conditional.

integer
nullable
field_values

Field values organized by branch key.

object
key
additional properties

Field values organized by locale code.

object
key
additional properties

Field values keyed by liquid variable name.

object
key
additional properties
object
value
required
One of:
string
link_tracking_parameters

Link tracking parameter values specific to this field.

object
key
additional properties
string
hidden_from_locales

A map of locale codes to boolean values indicating whether this component instance is hidden for that locale.

object
key
additional properties
boolean
link_tracking_parameters
object
branch_content

Per-component-instance link tracking parameter values, organized by branch key, then by locale code.

object
key
additional properties
object
key
additional properties

A map of link tracking parameter names to their values for this component instance.

object
key
additional properties
string
global_link_tracking_parameters

A map of link tracking parameter names to their values for this component instance.

object
key
additional properties
string
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

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"
}

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."
]
}
}