Update a template with settings
Update a template with settings
PATCH
/
emails
/
builder
/
{templateId}
Update a template with settings
curl --request PATCH \
--url https://services.leadconnectorhq.com/emails/builder/{templateId} \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"locationId": "ve9EPM428h8vShlRW1KT",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"editorContent": "<html><body>Hello World</body></html>",
"editorType": "html",
"previewText": "Email preview text",
"subjectLine": "Welcome to our newsletter",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"name": "Newsletter Template",
"archived": false
}
'const options = {
method: 'PATCH',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
locationId: 've9EPM428h8vShlRW1KT',
updatedBy: 'zYy3YOUuHxgomU1uYJty',
editorContent: '<html><body>Hello World</body></html>',
editorType: 'html',
previewText: 'Email preview text',
subjectLine: 'Welcome to our newsletter',
fromName: 'John Doe',
fromEmail: 'john@example.com',
name: 'Newsletter Template',
archived: false
})
};
fetch('https://services.leadconnectorhq.com/emails/builder/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/emails/builder/{templateId}"
payload = {
"locationId": "ve9EPM428h8vShlRW1KT",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"editorContent": "<html><body>Hello World</body></html>",
"editorType": "html",
"previewText": "Email preview text",
"subjectLine": "Welcome to our newsletter",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"name": "Newsletter Template",
"archived": False
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"id": "507f1f77bcf86cd799439011",
"name": "My Email Template",
"archived": false,
"builderVersion": "2",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"subjectLine": "Welcome to our newsletter",
"previewText": "Check out our latest updates",
"previewUrl": "https://example.com/preview/template123",
"type": "builder",
"lastUpdated": "2024-01-15T10:30:00Z",
"createdAt": "2024-01-01T08:00:00Z",
"isPlainText": false
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Body
application/json
Editor content - can be HTML string, plain text string, or DND builder object depending on editorType. When editorType is "html" or "text", this should be a string. When editorType is "builder", this should be a DND object with elements, attrs, and templateSettings. Must be provided together with editorType.
Example:
"<html><body>Hello World</body></html>"
Response
Success
Last modified on March 8, 2026
Was this page helpful?
Update a template with settings
curl --request PATCH \
--url https://services.leadconnectorhq.com/emails/builder/{templateId} \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"locationId": "ve9EPM428h8vShlRW1KT",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"editorContent": "<html><body>Hello World</body></html>",
"editorType": "html",
"previewText": "Email preview text",
"subjectLine": "Welcome to our newsletter",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"name": "Newsletter Template",
"archived": false
}
'const options = {
method: 'PATCH',
headers: {Version: '<version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
locationId: 've9EPM428h8vShlRW1KT',
updatedBy: 'zYy3YOUuHxgomU1uYJty',
editorContent: '<html><body>Hello World</body></html>',
editorType: 'html',
previewText: 'Email preview text',
subjectLine: 'Welcome to our newsletter',
fromName: 'John Doe',
fromEmail: 'john@example.com',
name: 'Newsletter Template',
archived: false
})
};
fetch('https://services.leadconnectorhq.com/emails/builder/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/emails/builder/{templateId}"
payload = {
"locationId": "ve9EPM428h8vShlRW1KT",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"editorContent": "<html><body>Hello World</body></html>",
"editorType": "html",
"previewText": "Email preview text",
"subjectLine": "Welcome to our newsletter",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"name": "Newsletter Template",
"archived": False
}
headers = {
"Version": "<version>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"id": "507f1f77bcf86cd799439011",
"name": "My Email Template",
"archived": false,
"builderVersion": "2",
"fromName": "John Doe",
"fromEmail": "john@example.com",
"subjectLine": "Welcome to our newsletter",
"previewText": "Check out our latest updates",
"previewUrl": "https://example.com/preview/template123",
"type": "builder",
"lastUpdated": "2024-01-15T10:30:00Z",
"createdAt": "2024-01-01T08:00:00Z",
"isPlainText": false
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}