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/generateGenerate a full email campaign with AI. Creates a campaign and generates subject line, preview text, and HTML content using your brand context.
Parameters
| Name | Type | Description |
|---|---|---|
promptrequired | string | What the email should be about |
campaignName | string | Display name for the campaign |
projectId | string | Project to associate the campaign with |
templateId | string | Base template to use for generation |
imageUrls | string[] | 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-shotGenerate email HTML without creating a campaign. Returns subject, preview text, and HTML directly. Use this when you just need the content.
Parameters
| Name | Type | Description |
|---|---|---|
promptrequired | string | What the email should be about |
style | object | Optional 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>..."
}
}