Templates

Create Template

Create a new email template with HTML or Topol editor JSON content. Automatically creates and publishes a template version with extracted merge tags.

post/templates

Request

  • Base URL: https://app.lettr.com/api
  • URL: https://app.lettr.com/api/templates
  • Auth: HTTP bearer

Request body

namestring required

Name of the template

project_idinteger

Project ID to create the template in. If not provided, uses the team's default project.

folder_idinteger

Folder ID to create the template in. Must belong to the same module as purpose. If not provided, the first folder of that module is used, and one is created when the project has none.

htmlstring

HTML content for custom HTML templates. Required if json is not provided. Mutually exclusive with json.

jsonstring

JSON content for Topol visual editor templates. Required if html is not provided. Mutually exclusive with html.

purpose'transactional' | 'campaign'

Module the template belongs to. transactional templates are the ones you send single emails with; campaign templates are the ones the campaign builder can pick. Defaults to transactional.

Example request

{
  "name": "Welcome Email",
  "project_id": 5,
  "folder_id": 10,
  "html": "<html><body><p>Hello {{NAME}}!</p></body></html>",
  "json": "{\"tagName\":\"mj-container\",\"children\":[{\"tagName\":\"mj-text\",\"content\":\"Hello {{FIRST_NAME}}!\"}]}",
  "purpose": "campaign"
}

Response

Template created successfully

messagestring required

Human-readable response message

Example response

{
  "message": "Template created successfully.",
  "data": {
    "id": 123,
    "name": "Welcome Email",
    "slug": "welcome-email",
    "project_id": 5,
    "folder_id": 10,
    "purpose": "campaign",
    "preparation_status": "ready",
    "active_version": 1,
    "merge_tags": [
      {
        "key": "first_name",
        "required": true,
        "type": "text",
        "children": [
          {
            "key": "item_name",
            "type": "text"
          }
        ]
      }
    ],
    "created_at": "2026-01-28T12:00:00+00:00"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.