New: the MailCraft MCP server is live โ€” connect your AI agent in one line. Connect your agent โ†’
API reference

Templates

Reusable, versioned email bodies rendered with Mustache syntax (`{{ name }}`). Organize them into folders. Campaigns and emails pin a specific version, so editing a template never changes past sends.

Create a template folder

POST
/template-folders

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Body ยท application/json

name
string
Create a template folder
curl https://api.mailcraft.host/v1/template-folders \
  -X POST \
  -H 'Authorization: Bearer sk_live_...' \
  -H 'Content-Type: application/json' \
  -d '{ "name": "Onboarding" }'
{
  "data": { "id": 2, "name": "Onboarding", "created_at": "2026-09-22T14:14:00.000000Z" }
}

List template folders

GET
/template-folders

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

List template folders
curl https://api.mailcraft.host/v1/template-folders \
  -H 'Authorization: Bearer sk_live_...'
{
  "data": [{ "id": 2, "name": "Onboarding" }]
}

Delete a template folder

DELETE
/template-folders/{folder}

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Delete a template folder
curl https://api.mailcraft.host/v1/template-folders/2 \
  -X DELETE \
  -H 'Authorization: Bearer sk_live_...'
(empty body)

Create a template

POST
/templates

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Body ยท application/json

name
string
template_folder_id
number
subject
string
html_body
string
variables
object
Create a template
curl https://api.mailcraft.host/v1/templates \
  -X POST \
  -H 'Authorization: Bearer sk_live_...' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Welcome email",
    "template_folder_id": 2,
    "subject": "Welcome, {{ first_name }}!",
    "html_body": "<p>Hi {{ first_name }}, thanks for joining.</p>",
    "variables": { "first_name": "string" }
  }'
{
  "data": {
    "id": 9,
    "template_folder_id": 2,
    "name": "Welcome email",
    "slug": "welcome-email",
    "subject": "Welcome, {{ first_name }}!",
    "html_body": "<p>Hi {{ first_name }}, thanks for joining.</p>",
    "text_body": null,
    "variables": { "first_name": "string" },
    "current_version": 1,
    "created_at": "2026-09-22T14:15:00.000000Z",
    "updated_at": "2026-09-22T14:15:00.000000Z"
  }
}

List templates

GET
/templates

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

List templates
curl https://api.mailcraft.host/v1/templates \
  -H 'Authorization: Bearer sk_live_...'
{
  "data": [
    { "id": 9, "name": "Welcome email", "slug": "welcome-email", "current_version": 1 }
  ]
}

Get a template

GET
/templates/{template}

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Get a template
curl https://api.mailcraft.host/v1/templates/9 \
  -H 'Authorization: Bearer sk_live_...'
{
  "data": {
    "id": 9,
    "template_folder_id": 2,
    "name": "Welcome email",
    "slug": "welcome-email",
    "subject": "Welcome, {{ first_name }}!",
    "html_body": "<p>Hi {{ first_name }}, thanks for joining.</p>",
    "text_body": null,
    "variables": { "first_name": "string" },
    "current_version": 1,
    "created_at": "2026-09-22T14:15:00.000000Z",
    "updated_at": "2026-09-22T14:15:00.000000Z"
  }
}

Update a template

Saves a new version. Past emails and campaigns keep rendering from the version they were pinned to.

PATCH
/templates/{template}

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Body ยท application/json

subject
string
Update a template
curl https://api.mailcraft.host/v1/templates/9 \
  -X PATCH \
  -H 'Authorization: Bearer sk_live_...' \
  -H 'Content-Type: application/json' \
  -d '{ "subject": "Welcome aboard, {{ first_name }}!" }'
{
  "data": {
    "id": 9,
    "subject": "Welcome aboard, {{ first_name }}!",
    "current_version": 2,
    "updated_at": "2026-09-22T16:00:00.000000Z"
  }
}

Delete a template

DELETE
/templates/{template}

Authorizations

Authorization
string
header
required

API key for your workspace, scoped to templates:manage. Pass it as a Bearer token in the Authorization header.

Delete a template
curl https://api.mailcraft.host/v1/templates/9 \
  -X DELETE \
  -H 'Authorization: Bearer sk_live_...'
(empty body)