Templates

Create and manage reusable email templates

List Templates

GET/v1/send/templates

List all templates with optional search and tag filtering.

Requires:send:read

Query Parameters

limitinteger
Results per page (max 100)Defaults to 50
offsetinteger
Number of results to skipDefaults to 0
searchstring
Search by template name
tagsstring
Comma-separated tag filter
List templates
curl "https://api.do.dev/v1/send/templates" \
-H "Authorization: Bearer YOUR_API_KEY"
Response200
{
"templates": [
  {
    "id": "tpl_abc123",
    "name": "Welcome Email",
    "subject": "Welcome {{name}}!",
    "tags": ["welcome", "onboarding"],
    "createdAt": 1707423600000
  }
],
"pagination": { "limit": 50, "offset": 0, "total": 5 }
}

Create Template

POST/v1/send/templates

Create a new reusable email template with variable support.

Requires:send:write

Body Parameters

namestringrequired
Template name
subjectstringrequired
Subject line (supports {{variables}})
htmlstring
HTML body (supports {{variables}})
textstring
Plain text body
descriptionstring
Template description
tagsstring[]
Tags for organization
variablesobject[]
Declared template variables
Create a template
curl -X POST "https://api.do.dev/v1/send/templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "name": "Welcome Email",
  "subject": "Welcome {{name}}!",
  "html": "<h1>Hi {{name}}</h1><p>Welcome to our platform.</p>",
  "variables": [{ "name": "name", "type": "string" }]
}'
Response201
{
"id": "tpl_abc123",
"name": "Welcome Email",
"subject": "Welcome {{name}}!",
"html": "<h1>Hi {{name}}</h1><p>Welcome to our platform.</p>",
"variables": [{ "name": "name", "type": "string" }],
"createdAt": 1707423600000
}

Update Template

PUT/v1/send/templates/{id}

Update an existing template. All fields are optional.

Requires:send:write

Delete Template

DELETE/v1/send/templates/{id}

Delete a template. Fails if the template is actively used in queued emails.

Requires:send:write