Create a new template
http
POST https://services.leadconnectorhq.com/emails/builderAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | ve9EPM428h8vShlRW1KT | |
title | string | No | template title | |
type | string | Yes | Possible values: 'html', 'folder', 'import', 'builder', 'blank' | |
updatedBy | string | No | zYy3YOUuHxgomU1uYJty | |
builderVersion | string | No | Possible values: '1', '2' | |
name | string | No | Template1 | |
parentId | string | No | zYy3YOUuHxgomU1uYJty | |
templateDataUrl | string | No | ||
importProvider | string | Yes | Possible values: 'mailchimp', 'active_campaign', 'kajabi' | |
importURL | string | No | https://tplshare.com/fhYJ3Mi | |
templateSource | string | No | template_library | |
isPlainText | boolean | No | False |
Responses
201 - Success
redirect(string, required): template id Example:66e811229245fc098765590traceId(string, required): trace id Example:0c52e980-41f6-4be7-8c4b-e2c5a13dc3c2
json
{
"redirect": "66e811229245fc098765590",
"traceId": "0c52e980-41f6-4be7-8c4b-e2c5a13dc3c2"
}400 - Bad Request
json
{}404 - Not Found
422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/emails/builder' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "ve9EPM428h8vShlRW1KT",
"title": "template title",
"type": "html",
"updatedBy": "zYy3YOUuHxgomU1uYJty",
"builderVersion": "2",
"name": "Template1",
"parentId": "zYy3YOUuHxgomU1uYJty",
"templateDataUrl": "",
"importProvider": "mailchimp",
"importURL": "https://tplshare.com/fhYJ3Mi",
"templateSource": "template_library",
"isPlainText": false
}'const response = await fetch('https://services.leadconnectorhq.com/emails/builder', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "ve9EPM428h8vShlRW1KT", "title": "template title", "type": "html", "updatedBy": "zYy3YOUuHxgomU1uYJty", "builderVersion": "2", "name": "Template1", "parentId": "zYy3YOUuHxgomU1uYJty", "templateDataUrl": "", "importProvider": "mailchimp", "importURL": "https://tplshare.com/fhYJ3Mi", "templateSource": "template_library", "isPlainText": false}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/emails/builder',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "ve9EPM428h8vShlRW1KT", "title": "template title", "type": "html", "updatedBy": "zYy3YOUuHxgomU1uYJty", "builderVersion": "2", "name": "Template1", "parentId": "zYy3YOUuHxgomU1uYJty", "templateDataUrl": "", "importProvider": "mailchimp", "importURL": "https://tplshare.com/fhYJ3Mi", "templateSource": "template_library", "isPlainText": false},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/emails/builder');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': 've9EPM428h8vShlRW1KT', 'title': 'template title', 'type': 'html', 'updatedBy': 'zYy3YOUuHxgomU1uYJty', 'builderVersion': '2', 'name': 'Template1', 'parentId': 'zYy3YOUuHxgomU1uYJty', 'templateDataUrl': '', 'importProvider': 'mailchimp', 'importURL': 'https://tplshare.com/fhYJ3Mi', 'templateSource': 'template_library', 'isPlainText': false}),
]);
$data = json_decode(curl_exec($ch), true);