v97

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-04231129815.9 KB
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

promptstring required

What you want the email to say or accomplish.

stylestring

Optional style guidance.

tonestring

Optional tone guidance.

applyBrandingboolean

Whether to wrap generated content with the company logo and footer. Set to false to return raw generated content blocks.

emailType'marketing' | 'transactional'

Email type. Transactional emails include a footer without an unsubscribe link.

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
      },
      "conditions": [
        {
          "id": "c1",
          "value": "plan:pro"
        }
      ]
    }
  ],
  "message": "Generated a draft email."
}