Skip to main content
PUT
/
templates
/
{slug}
curl --request PUT \ --url https://app.lettr.com/api/templates/{slug} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "name": "Updated Welcome Email" } '
{ "message": "Template updated successfully.", "data": { "id": 123, "name": "Updated Welcome Email", "slug": "welcome-email", "project_id": 5, "folder_id": 10, "active_version": 2, "merge_tags": [ { "key": "NAME", "required": true } ], "created_at": "2026-01-15T10:00:00+00:00", "updated_at": "2026-01-28T14:30:00+00:00" } }
Updates an existing template by its slug. You can update the template name, project assignment, or content. Providing new html or json content creates a new version of the template automatically. The html and json fields are mutually exclusive. If neither is provided, only metadata (name, project) is updated without creating a new version.

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

slug
string
required

The template slug (URL-friendly identifier)

Example:

"welcome-email"

Body

application/json

Request to update an existing email template. All fields are optional - provide only what you want to change. If html or json is provided, a new active version will be created.

project_id
integer

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

Required range: x >= 1
Example:

5

name
string

New name for the template

Maximum string length: 255
Example:

"Updated Welcome Email"

html
string

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

Example:

"<html><body><p>Hello {{NAME}}!</p></body></html>"

json
string

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

Example:

"{\"tagName\":\"mj-container\",\"children\":[{\"tagName\":\"mj-text\",\"content\":\"Hello {{FIRST_NAME}}!\"}]}"

Response

Template updated successfully

Response after successfully updating a template

message
string
required

Human-readable response message

Example:

"Template updated successfully."

data
object
required

View of an updated template