Email Templates API

The email templates resource supports migration, governance, and external template sync. This guide explains when to use templates, how to preserve structured editor content, and how to keep template names and descriptions useful for workspace users.

6 min read

Manage Reusable Email Templates

Email templates are reusable layouts and content blocks that help teams create consistent emails. They can be used as starting points for broadcasts, sequences, and other email workflows.

Use the email templates API for migrations from another email platform, external content governance, approved template libraries, or internal tools that keep brand-approved layouts synchronized.

Template changes can affect how future emails are created. Make names, descriptions, and content clear enough that workspace users understand when to use each template.

  1. List current templates before importing a new library.
  2. Create or update one template at a time so review is easier.
  3. Use a plain name and description that match how users choose templates in Email Templates.
  4. Preserve structured body_document content exactly as the public schema expects.
  5. Preview or test the template in Mailrith before telling users to create broadcasts or sequences from it.
  6. Delete templates only after confirming they are no longer useful as starting points.
  • List templates to build a template picker in an external tool.
  • Create templates when importing approved layouts or starting a new workspace setup.
  • Update templates when your design system or approved copy changes.
  • Delete templates only after confirming they are no longer needed as a starting point.

Endpoint Overview

GET /v1/email-templates lists reusable templates. Item endpoints let your integration inspect, update, or delete one template.

POST /v1/email-templates creates a template. Template payloads include the structured email body document used by the Mailrith editor.

Treat body_document as structured editor content, not as plain text. Preserve the structure generated by your source system or by Mailrith's documented schema.

GET /v1/email-templates

List email templates

Returns reusable email templates linked to the authenticated workspace.

View Schema
POST /v1/email-templates

Create an email template

Creates a reusable email template scoped to the authenticated workspace.

View Schema
GET /v1/email-templates/{template_id}

Get an email template

Returns a reusable email template linked to the authenticated workspace.

View Schema
PUT /v1/email-templates/{template_id}

Update an email template

Updates the content or enabled state of an existing email template.

View Schema
DELETE /v1/email-templates/{template_id}

Delete an email template

Deletes an existing email template linked to the authenticated workspace.

View Schema
Create an Email Template
curl -X POST https://api.mailrith.com/v1/email-templates \
  -H "Authorization: Bearer mrk_example_secret_key" \
  -H "Idempotency-Key: template-welcome-v1" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome newsletter",
    "description": "Default newsletter layout for the workspace",
    "enabled": true,
    "body_document": {
      "type": "doc",
      "content": []
    }
  }'

Need Help Shipping an Integration?

Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.

Contact Mailrith

Related Guides

On this page

Jump to the section you need.