DocumentationTemplates and versions

Templates and versions

Draft vs Published versions and sending with templateVersionId.

MailingCore templates use versioned content. Each template can have multiple versions; only a Published version can be used in production sends.

Draft vs Published

StateEditableUsable in POST /emails/send
DraftYesNo
PublishedNo (create a new draft or unpublish first)Yes

Workflow:

  1. Create a template (POST /templates) with an initial version (Draft).
  2. Edit HTML, subject, and variables in the dashboard or via PATCH /templates/:id/versions/:versionId.
  3. Publish the version when ready — see Publish workflow.
  4. Send with templateVersionId set to the published version ID.
{
  "to": "[email protected]",
  "subject": "Order confirmed",
  "htmlBody": "<p>Fallback if not using template</p>",
  "templateVersionId": "clxversion_published..."
}

When templateVersionId is provided, MailingCore renders the published HTML and subject. You can still override subject in the send payload if your integration requires it.

Locale variants

Versions may include a locale (es, en, it, fr, ca, de) and localeGroupId to group equivalent translations. Campaign sends can pick the best match for each contact.

Management endpoints

ActionEndpointAuth
List templatesGET /templatesJWT
Create templatePOST /templatesJWT
Add versionPOST /templates/:id/versionsJWT
Update versionPATCH /templates/:id/versions/:versionIdJWT
PublishPOST /templates/:id/versions/:versionId/publishJWT

Template CRUD requires a dashboard JWT, not an API key. Sending uses an API key with email:send.

Next steps