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/templatesList 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/templatesCreate a new email template. You can provide raw HTML or save a campaign's generated content as a reusable template.
Parameters
| Name | Type | Description |
|---|---|---|
namerequired | string | Display name for the template |
category | string | Category for organization (e.g. "onboarding", "newsletter") |
sourceCampaignId | string | Copy HTML from an existing campaign |
htmlContent | string | Raw 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/:idGet 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/:idUpdate an existing template. All fields are optional — only provided fields will be changed.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Updated display name |
category | string | Updated category |
htmlContent | string | Updated 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/:idDelete 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
}
}