curl --request PATCH \
--url https://services.leadconnectorhq.com/emails/builder/{templateId} \
--header 'Authorization: Bearer <token>' \
--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
}
'{
"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
}Update a template with settings
curl --request PATCH \
--url https://services.leadconnectorhq.com/emails/builder/{templateId} \
--header 'Authorization: Bearer <token>' \
--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
}
'{
"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
}Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.
API Version
2021-07-28 "2021-07-28"
Location ID where the template belongs
"ve9EPM428h8vShlRW1KT"
User ID who is updating the template
"zYy3YOUuHxgomU1uYJty"
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.
"<html><body>Hello World</body></html>"
Type of editor content: "html" for HTML content, "text" for plain text content, "builder" for drag-and-drop builder content. Must be provided together with editorContent.
html, builder, text "html"
Preview text shown in email clients before opening
"Email preview text"
Email subject line
"Welcome to our newsletter"
Sender name displayed in email
"John Doe"
Sender email address
"john@example.com"
Template name
"Newsletter Template"
Whether the template is archived
false
Success
Indicates if the update was successful
true
Unique template identifier
"507f1f77bcf86cd799439011"
Template name
"My Email Template"
Whether the template is archived
false
Builder version used for the template
"2"
Sender name displayed in email
"John Doe"
Sender email address
"john@example.com"
Email subject line
"Welcome to our newsletter"
Preview text shown in email clients
"Check out our latest updates"
URL to preview the rendered template
"https://example.com/preview/template123"
Type of template editor used
html, builder "builder"
Timestamp of last update
"2024-01-15T10:30:00Z"
Timestamp when template was created
"2024-01-01T08:00:00Z"
Whether the template contains plain text content (true) or HTML content (false)
false
Was this page helpful?