ClawdMaildocs

Templates

Manage reusable email templates.

Templates let you save and reuse email designs. Create them manually with HTML or save a generated campaign as a template for future use.
GET/api/v1/templates

List all email templates in your workspace.

Example

curl https://app.clawdmail.ai/api/v1/templates \
  -H "Authorization: Bearer cm_live_your_key"

Response

{
  "data": [
    {
      "id": "tmpl_abc123",
      "name": "Welcome Email",
      "category": "onboarding",
      "createdAt": "2026-02-10T08:30:00Z",
      "updatedAt": "2026-02-20T14:15:00Z"
    },
    {
      "id": "tmpl_def456",
      "name": "Monthly Newsletter",
      "category": "newsletter",
      "createdAt": "2026-01-05T10:00:00Z",
      "updatedAt": "2026-03-01T09:00:00Z"
    }
  ]
}
POST/api/v1/templates

Create a new email template. You can provide raw HTML or save a campaign's generated content as a reusable template.

Parameters

NameTypeDescription
namerequiredstringDisplay name for the template
categorystringCategory for organization (e.g. "onboarding", "newsletter")
sourceCampaignIdstringCopy HTML from an existing campaign
htmlContentstringRaw HTML content for the template

Example

curl -X POST https://app.clawdmail.ai/api/v1/templates \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Launch",
    "category": "marketing",
    "htmlContent": "<html><body><h1>New Release</h1></body></html>"
  }'

Response

{
  "data": {
    "id": "tmpl_g7h8i9",
    "name": "Product Launch",
    "category": "marketing",
    "createdAt": "2026-03-04T12:00:00Z"
  }
}
GET/api/v1/templates/:id

Get a template by ID, including its full HTML content.

Example

curl https://app.clawdmail.ai/api/v1/templates/tmpl_abc123 \
  -H "Authorization: Bearer cm_live_your_key"

Response

{
  "data": {
    "id": "tmpl_abc123",
    "name": "Welcome Email",
    "category": "onboarding",
    "htmlContent": "<!DOCTYPE html><html>...",
    "createdAt": "2026-02-10T08:30:00Z",
    "updatedAt": "2026-02-20T14:15:00Z"
  }
}
PUT/api/v1/templates/:id

Update an existing template. All fields are optional — only provided fields will be changed.

Parameters

NameTypeDescription
namestringUpdated display name
categorystringUpdated category
htmlContentstringUpdated HTML content

Example

curl -X PUT https://app.clawdmail.ai/api/v1/templates/tmpl_abc123 \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome Email v2",
    "htmlContent": "<html><body><h1>Welcome!</h1></body></html>"
  }'

Response

{
  "data": {
    "id": "tmpl_abc123",
    "name": "Welcome Email v2",
    "category": "onboarding",
    "updatedAt": "2026-03-04T12:00:00Z"
  }
}
DELETE/api/v1/templates/:id

Delete a template by ID. This action cannot be undone.

Example

curl -X DELETE https://app.clawdmail.ai/api/v1/templates/tmpl_abc123 \
  -H "Authorization: Bearer cm_live_your_key"

Response

{
  "data": {
    "success": true
  }
}