Emails
Create email
Creates an email template with block content. Raw HTML is stored as a native HTML body.
post/emails
Request body
Example request
{
"html": "<h1>Hello</h1>",
"blocks": [
{
"id": "block_123",
"type": "html",
"content": "<h1>Hello</h1>",
"styles": {
"backgroundColor": "#f8fafc",
"backgroundOpacity": 80,
"textColor": "#111827",
"borderRadius": 12,
"borderColor": "#cbd5e1",
"borderWidth": 1
},
"conditions": [
{
"id": "c1",
"value": "plan:pro"
}
]
}
],
"name": "Welcome email",
"subject": "Welcome",
"previewText": "Here's what to do next"
}Response
Email created
Example response
{
"success": true,
"email": {
"id": "email_123",
"companyId": "company_123",
"name": "Welcome email",
"subject": "Welcome",
"previewText": "Here's what to do next",
"blocks": [
{
"id": "block_123",
"type": "html",
"content": "<h1>Hello</h1>",
"styles": {
"backgroundColor": "#f8fafc",
"backgroundOpacity": 80,
"textColor": "#111827",
"borderRadius": 12,
"borderColor": "#cbd5e1",
"borderWidth": 1
},
"conditions": [
{
"id": "c1",
"value": "plan:pro"
}
]
}
]
},
"warnings": [
"blocks[0].styles.color is not a supported field and was ignored. Button label color comes from the block-level `buttonTextColor` field. Supported styles fields: backgroundColor, backgroundOpacity, bleed, borderColor, borderRadius, borderWidth, paddingBottom, paddingLeft, paddingRight, paddingTop, textAlign, textColor."
]
}