✉ MailCraft API Reference

Templates

Create template

Session only
POST/api/v1/templates

Creates a draft template. Requires a dashboard session — an API key gets 403 Forbidden. Response captured with a dashboard session.

Body Parameters

Notes

Verified 2026-11-02 in Postman with a DASHBOARD SESSION (cookie + CSRF), NOT an mc_live_ key: the same call with an API key returns 403 Forbidden (errorApiKey, live). The request body keys are name, category, content, htmlContent (not html), alias, from, subject, replyTo, text, variables[{key, type, fallbackValue}]. Request variable type is the string 'string' (response: integer 0); the other accepted types are UNVERIFIED (verify live). content:null is accepted and stored as '{}'. Created as draft (isPublished false, status 'draft'). Names/ids in this sample were renamed to apitest-*.

Errors

StatusCaseBody
403errorApiKey{"error": {"code": "Forbidden", "message": "You do not have permission to perform this action."}}
400errorTooManyVariables{"error": {"code": "ValidationFailed", "message": "A template can have at most 50 variables."}}
409errorDuplicateAlias{"error": {"code": "Conflict", "message": "A template with this alias already exists."}}

Snippets use the MailCraftApi (C#) and MailCraft (Python) helpers from Introduction → Helpers.