Templates

Update Template

Update an existing email template's name and/or content. If content (html or json) is provided, a new active version will be created with extracted merge tags. If project_id is not provided, the template will be looked up in the team's default project.

put/templates/{slug}

Request

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

Path parameters

slugstring required
Example:welcome-email

The template slug (URL-friendly identifier)

Request body

project_idinteger

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

namestring

New name for the template

htmlstring

New HTML content for the template. Creates a new active version. Mutually exclusive with json.

jsonstring

New JSON content for Topol visual editor templates. Creates a new active version. Mutually exclusive with html.

Example request

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

Response

Template updated successfully

messagestring required

Human-readable response message

Example response

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

Changes

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