Generation
Generate email
Generates a draft email from scratch as structured editor-compatible blocks. By default, the generated content is wrapped with the company's logo and footer.
post/generate/email
Request body
Example request
{
"prompt": "Announce our new analytics dashboard to trial users",
"style": "branded",
"tone": "friendly"
}Response
Email generated successfully
Example response
{
"success": true,
"subject": "Meet your new analytics dashboard",
"previewText": "A clearer way to track what matters",
"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"
}
]
}
],
"message": "Generated a draft email."
}