Skip to content

Create Component

POST
/api/v1/workspaces/{workspace_id}/email_design_systems/{emailDesignSystemId}/components
curl --request POST \
--url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/email_design_systems/1/components \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "hero_banner", "label": "Hero Banner", "template": "<tr><td style=\"padding: 20px;\"><h1>{{title}}</h1><p>{{description}}</p></td></tr>", "field_definitions": [ { "type": "text", "label": "example", "group": "Styling", "liquid_variable": "heading_text", "visible_if": "show_heading == true", "default_value": "example", "validations": { "min_length": 1, "max_length": 1, "must_not_be_blank": true, "must_not_be_default": true }, "hint": "Keep this short and punchy", "hidden_in_editor": true, "hidden_from_ai": true, "feed_field_name": "example" } ], "feed_id": 1, "deprecated": true }'

Creates a new component.

  • OAuth2
    email_design_systems:write
workspace_id
required
integer

Workspace ID

emailDesignSystemId
required
integer

Email Design System ID

Media typeapplication/json
object
name
required

A unique identifier for the component (used in code/templates).

string
Example
hero_banner
label
required

The human-readable display name of the component.

string
Example
Hero Banner
template
required

The Liquid HTML template for the component.

string
Example
<tr><td style="padding: 20px;"><h1>{{title}}</h1><p>{{description}}</p></td></tr>
field_definitions
required
Array
One of:
object
type
required
string
Allowed values: text
label
required
string
group

An optional label used to group related fields together in the editor.

string
nullable
Example
Styling
liquid_variable
required

The Liquid variable name used to reference this field in templates.

string
Example
heading_text
visible_if

A Liquid expression (without the surrounding {% %}) that determines when this field is visible in the editor.

string
Example
show_heading == true
default_value
required
string
validations
object
min_length
integer
max_length
integer
must_not_be_blank
boolean
must_not_be_default
boolean
hint

Helper text displayed below the field in the editor.

string
Example
Keep this short and punchy
hidden_in_editor

Whether this field is hidden from the editor UI.

boolean
hidden_from_ai

Whether this field is hidden from AI Agents.

boolean
feed_field_name

The name of the feed field that populates this field’s value. If null, this field is not populated from a feed.

string
nullable
feed_id

The ID of the data feed to associate with this component. If null, no feed is linked.

integer
nullable
Example
1
deprecated
boolean

Successful

Media typeapplication/json
object
name
required
string
label
required
string
description
required
string
nullable
email_design_system_id
required
integer
updated_at
required
string format: date-time
created_at
required
string format: date-time
container
boolean
nullable
template
required
string
field_definitions
required
Array
One of:
object
type
required
string
Allowed values: text
label
required
string
group

An optional label used to group related fields together in the editor.

string
nullable
liquid_variable
required

The Liquid variable name used to reference this field in templates.

string
visible_if

A Liquid expression (without the surrounding {% %}) that determines when this field is visible in the editor.

string
default_value
required
string
validations
object
min_length
integer
max_length
integer
must_not_be_blank
boolean
must_not_be_default
boolean
hint

Helper text displayed below the field in the editor.

string
hidden_in_editor

Whether this field is hidden from the editor UI.

boolean
hidden_from_ai

Whether this field is hidden from AI Agents.

boolean
feed_field_name

The name of the feed field that populates this field’s value. If null, this field is not populated from a feed.

string
nullable
screenshot_url
required
string
position
required
integer
nullable
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
feed_id
required
integer
nullable
deprecated
required
boolean
Example
{
"name": "MyComponent",
"label": "My Component",
"description": "A hero banner image with a headline and image, body text and a call to action button.",
"email_design_system_id": 12345,
"updated_at": "2023-08-23T10:30:00.000Z",
"created_at": "2023-08-23T10:30:00.000Z",
"container": false,
"template": "<div>My Component</div>",
"field_definitions": [
{
"type": "text",
"group": "Styling",
"liquid_variable": "heading_text",
"visible_if": "show_heading == true",
"hint": "Keep this short and punchy"
}
],
"screenshot_url": "https://www.example.com/screenshot.png",
"position": 1,
"last_updated_by": {
"type": "User",
"id": 12345,
"first_name": "John",
"last_name": "Smith",
"profile_image_url": "https://example.com/profile.jpg"
},
"feed_id": 12345,
"deprecated": false
}

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