ClawdMaildocs

Email Generation

Create production-ready, on-brand emails with a single API call. Describe what you want in plain English and ClawdMail handles subject lines, preview text, and fully responsive HTML.

This is what makes ClawdMail unique. Other email APIs require you to build the HTML yourself. ClawdMail generates production-ready, on-brand emails from a simple text prompt.

Generate Campaign

POST/api/v1/emails/generate

Generate a full email campaign with AI. Creates a campaign and generates subject line, preview text, and HTML content using your brand context.

Parameters

NameTypeDescription
promptrequiredstringWhat the email should be about
campaignNamestringDisplay name for the campaign
projectIdstringProject to associate the campaign with
templateIdstringBase template to use for generation
imageUrlsstring[]Images to include in the email body

Example

curl -X POST https://app.clawdmail.ai/api/v1/emails/generate \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A welcome email for new users that highlights our 3 core features and includes a CTA to start their free trial",
    "campaignName": "Welcome Series — Day 1"
  }'

Response

{
  "data": {
    "taskId": "task_8f3a1b2c4d5e",
    "campaignId": "camp_9e7d6c5b4a3f",
    "status": "generating"
  }
}
Generation takes 15-30 seconds. Poll GET /api/v1/campaigns/{campaignId} until htmlContent is populated.

One-Shot Generation

POST/api/v1/emails/generate-one-shot

Generate email HTML without creating a campaign. Returns subject, preview text, and HTML directly. Use this when you just need the content.

Parameters

NameTypeDescription
promptrequiredstringWhat the email should be about
styleobjectOptional style overrides — tone ("friendly", "formal", "playful") and length ("short", "medium", "long")

Example

curl -X POST https://app.clawdmail.ai/api/v1/emails/generate-one-shot \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Quick product update announcing dark mode support",
    "style": { "tone": "friendly", "length": "short" }
  }'

Response

{
  "data": {
    "subjectLine": "Big news: dark mode is here 🌙",
    "previewText": "Your inbox just got a whole lot easier on the eyes.",
    "htmlContent": "<!DOCTYPE html><html>..."
  }
}