curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Onboarding Email Template",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"category": "my-templates",
"editor_type": "drag-and-drop"
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/templates"
payload = {
"name": "Onboarding Email Template",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"category": "my-templates",
"editor_type": "drag-and-drop"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Onboarding Email Template',
design: '{"type":"doc","content":[{"type":"paragraph","content":[]}]}',
category: 'my-templates',
editor_type: 'drag-and-drop'
})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Onboarding Email Template\",\n \"design\": \"{\\\"type\\\":\\\"doc\\\",\\\"content\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[]}]}\",\n \"category\": \"my-templates\",\n \"editor_type\": \"drag-and-drop\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Onboarding Email Template',
'design' => '{"type":"doc","content":[{"type":"paragraph","content":[]}]}',
'category' => 'my-templates',
'editor_type' => 'drag-and-drop'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.instantly.ai/api/v2/email-marketing/templates"
payload := strings.NewReader("{\n \"name\": \"Onboarding Email Template\",\n \"design\": \"{\\\"type\\\":\\\"doc\\\",\\\"content\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[]}]}\",\n \"category\": \"my-templates\",\n \"editor_type\": \"drag-and-drop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "01a20d6a-b931-77ef-a291-0dbb953d01a0",
"name": "Onboarding Email Template",
"html": "<html><body>Hello {{first_name}}!</body></html>",
"text": "Hello {{first_name}}! Welcome to our newsletter.",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"workspace_id": "01a20d6a-b931-77ef-a291-0dbc164719be",
"editor_type": "drag-and-drop",
"timestamp_created": "2026-11-24T11:57:07.761Z",
"timestamp_updated": "2026-11-24T11:57:07.761Z",
"created_by": "01a20d6a-b931-77ef-a291-0dbd000b642e",
"actor_type": "user",
"description": "Onboarding welcome email template",
"category": "my-templates",
"default_values": {
"first_name": null,
"last_name": null
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Template not found",
"code": "TEMPLATE_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}Create a template
Creates a drag-and-drop template from design. The HTML is rendered from the design: any html sent is not used, but must still be 1 to 2,097,152 bytes. default_values are ignored (set them with an update).
Requires one of the following scopes: email_marketing_templates:create, email_marketing_templates:all, all:create, all:all
curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Onboarding Email Template",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"category": "my-templates",
"editor_type": "drag-and-drop"
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/templates"
payload = {
"name": "Onboarding Email Template",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"category": "my-templates",
"editor_type": "drag-and-drop"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Onboarding Email Template',
design: '{"type":"doc","content":[{"type":"paragraph","content":[]}]}',
category: 'my-templates',
editor_type: 'drag-and-drop'
})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Onboarding Email Template\",\n \"design\": \"{\\\"type\\\":\\\"doc\\\",\\\"content\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[]}]}\",\n \"category\": \"my-templates\",\n \"editor_type\": \"drag-and-drop\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Onboarding Email Template',
'design' => '{"type":"doc","content":[{"type":"paragraph","content":[]}]}',
'category' => 'my-templates',
'editor_type' => 'drag-and-drop'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.instantly.ai/api/v2/email-marketing/templates"
payload := strings.NewReader("{\n \"name\": \"Onboarding Email Template\",\n \"design\": \"{\\\"type\\\":\\\"doc\\\",\\\"content\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[]}]}\",\n \"category\": \"my-templates\",\n \"editor_type\": \"drag-and-drop\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "01a20d6a-b931-77ef-a291-0dbb953d01a0",
"name": "Onboarding Email Template",
"html": "<html><body>Hello {{first_name}}!</body></html>",
"text": "Hello {{first_name}}! Welcome to our newsletter.",
"design": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}",
"workspace_id": "01a20d6a-b931-77ef-a291-0dbc164719be",
"editor_type": "drag-and-drop",
"timestamp_created": "2026-11-24T11:57:07.761Z",
"timestamp_updated": "2026-11-24T11:57:07.761Z",
"created_by": "01a20d6a-b931-77ef-a291-0dbd000b642e",
"actor_type": "user",
"description": "Onboarding welcome email template",
"category": "my-templates",
"default_values": {
"first_name": null,
"last_name": null
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Template not found",
"code": "TEMPLATE_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}Authorizations
Body
The Template to create
The Template to create
Design of the drag-and-drop editor, as a JSON string. At most 5 MB (5,242,880 bytes) in UTF-8. The HTML is rendered from it. A template used in a broadcast or journey email must contain an {{unsubscribe_url}} link; without one, sending is refused with code MISSING_UNSUBSCRIBE_URL.
1"{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}"
Response
The Template
An email marketing template. Optional fields with no value are left out of responses. Lists page with starting_after: pass the previous page's next_starting_after until there is none.
Design of the drag-and-drop editor, as a JSON string. At most 5 MB (5,242,880 bytes) in UTF-8. The HTML is rendered from it. A template used in a broadcast or journey email must contain an {{unsubscribe_url}} link; without one, sending is refused with code MISSING_UNSUBSCRIBE_URL.
"{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[]}]}"