Generation

Generate email

Generates a draft marketing email from scratch as structured editor-compatible blocks.

post/generate/email

Request body

promptstring required

What you want the email to say or accomplish.

stylestring

Optional style guidance.

tonestring

Optional tone guidance.

Example request

{
  "prompt": "Announce our new analytics dashboard to trial users",
  "style": "branded",
  "tone": "friendly"
}

Response

Email generated successfully

successboolean
subjectstring
previewTextstring
messagestring

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
      }
    }
  ],
  "message": "Generated a draft email."
}

Changes