Skip to main content
Create a new template
POST https://services.leadconnectorhq.com/emails/builder

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Body

locationId
string
default:"ve9EPM428h8vShlRW1KT"
required
title
string
default:"template title"
type
string
required
Posibles valores: ‘html’, ‘folder’, ‘import’, ‘builder’, ‘blank’
updatedBy
string
default:"zYy3YOUuHxgomU1uYJty"
builderVersion
string
Posibles valores: ‘1’, ‘2’
name
string
default:"Template1"
parentId
string
default:"zYy3YOUuHxgomU1uYJty"
templateDataUrl
string
default:""
importProvider
string
required
Posibles valores: ‘mailchimp’, ‘active_campaign’, ‘kajabi’
importURL
string
default:"https://tplshare.com/fhYJ3Mi"
templateSource
string
default:"template_library"
isPlainText
boolean
default:"False"

Respuestas

redirect
string
default:"66e811229245fc098765590"
required
template id
traceId
string
default:"0c52e980-41f6-4be7-8c4b-e2c5a13dc3c2"
required
trace id
{
  "redirect": "66e811229245fc098765590",
  "traceId": "0c52e980-41f6-4be7-8c4b-e2c5a13dc3c2"
}
{}
{}
{}

Ejemplo

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);