Update Template
PUT/template/:templateId
Replaces the content of an existing saved template
This is a full replace of name, subject, previewText, html and css: a field left out of the request is cleared (css becomes empty).
The editor type and tags set in the app are kept.
Request
Path Parameters
ID of the template to update
- application/json
Body
required
Possible values: <= 256 characters
Template name, unique within the account
Possible values: <= 150 characters
Default subject for campaigns created from this template
Possible values: <= 150 characters
Default preview text (preheader) for campaigns created from this template
Full HTML of the email
Optional CSS kept alongside the HTML. Defaults to empty.
Responses
- 200
- 412
successful operation
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [DRAG_AND_DROP, HTML]
Editor the template opens in. Always HTML for templates created through the API.
Creation time in epoch milliseconds
Last update time in epoch milliseconds
{
"id": "8a6e0f6c-2b7d-4a8e-9a5e-6f1d2c3b4a59",
"name": "Welcome Email",
"subject": "Welcome!",
"previewText": "Thanks for joining us",
"html": "<html><body><h1>Welcome</h1></body></html>",
"css": "h1 { color: #333333; }",
"editorType": "HTML",
"createdAt": 1790848800000,
"updatedAt": 1790848800000
}
Precondition Failed. The template was not found in your account, or the request failed validation:
a duplicate name (errorCodes[0].errorCode = 4.4.001), a missing name or html, or a field over its maximum length.
- application/json
- Schema
- Example (from schema)
- Duplicate name
- Missing field
- Field too long
- Template not found
Schema
- Array [
- ]
errorCodes object[]
{
"message": "Some error message",
"messageDetails": "string",
"errorCodes": [
{
"errorCode": "string",
"errorMessage": "string"
}
]
}
{
"message": "Template with name 'Welcome Email' already exists for this account!",
"errorCodes": [
{
"errorCode": "4.4.001",
"errorMessage": "Template with name 'Welcome Email' already exists for this account!"
}
]
}
{
"message": "name must not be blank"
}
{
"message": "subject may not exceed 150 characters"
}
{
"message": "Template 8a6e0f6c-2b7d-4a8e-9a5e-6f1d2c3b4a59 not found"
}