Create email template
Create an email template as a DRAFT, from either a block document (like the drag-and-drop builder) or raw html. The deliverable HTML and plain text are produced server-side; variables in the subject and body resolve at send. Publish it with email_templates_update (status PUBLISHED) before a journey can send it. Minimal blocks example: { "name": "Recordatorio", "subject": "Hola {{customer.name}}", "document": { "blocks": [ { "type": "heading", "text": "Tu pago vence pronto" }, { "type": "text", "text": "Hola {{customer.name}}, ..." }, { "type": "button", "text": "Pagar", "href": "https://..." }, { "type": "footer", "text": "Empresa, dirección" } ] } }.
curl --request POST \
--url https://www.useboom.ai/api/v1/email-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"html": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
}
'import requests
url = "https://www.useboom.ai/api/v1/email-templates"
payload = {
"name": "<string>",
"subject": "<string>",
"html": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
}
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: '<string>',
subject: '<string>',
html: '<string>',
fromSenderId: '<string>',
replyToSenderId: '<string>'
})
};
fetch('https://www.useboom.ai/api/v1/email-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.useboom.ai/api/v1/email-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' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'fromSenderId' => '<string>',
'replyToSenderId' => '<string>'
]),
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://www.useboom.ai/api/v1/email-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://www.useboom.ai/api/v1/email-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.useboom.ai/api/v1/email-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "<string>",
"name": "<string>",
"subject": "<string>",
"status": "DRAFT",
"authoringMode": "BLOCKS",
"updatedAt": "<string>",
"variables": [
{
"key": "<string>",
"path": "<string>"
}
],
"document": "<unknown>",
"html": "<string>",
"renderedHtml": "<string>",
"text": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
},
"removed": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Organization API key, sent as Authorization: Bearer boom_org_....
Body
Internal name, not shown to recipients.
1Subject line; may contain {{path}} variables.
1Block-builder content. Send exactly one of document or html.
Show child attributes
Show child attributes
Hand-written HTML (the template becomes an HTML template). Sanitized on save — scripts, event handlers and external stylesheets are removed and listed in removed. Variables use the same {{path}} grammar.
1Sender id to send From. Must be on the verified domain (usableAsFrom in journeys_email_templates). Null/omitted = the org default.
Sender id for Reply-To. Null/omitted = the org default.
Was this page helpful?
curl --request POST \
--url https://www.useboom.ai/api/v1/email-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"html": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
}
'import requests
url = "https://www.useboom.ai/api/v1/email-templates"
payload = {
"name": "<string>",
"subject": "<string>",
"html": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
}
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: '<string>',
subject: '<string>',
html: '<string>',
fromSenderId: '<string>',
replyToSenderId: '<string>'
})
};
fetch('https://www.useboom.ai/api/v1/email-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.useboom.ai/api/v1/email-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' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'fromSenderId' => '<string>',
'replyToSenderId' => '<string>'
]),
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://www.useboom.ai/api/v1/email-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://www.useboom.ai/api/v1/email-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.useboom.ai/api/v1/email-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"fromSenderId\": \"<string>\",\n \"replyToSenderId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "<string>",
"name": "<string>",
"subject": "<string>",
"status": "DRAFT",
"authoringMode": "BLOCKS",
"updatedAt": "<string>",
"variables": [
{
"key": "<string>",
"path": "<string>"
}
],
"document": "<unknown>",
"html": "<string>",
"renderedHtml": "<string>",
"text": "<string>",
"fromSenderId": "<string>",
"replyToSenderId": "<string>"
},
"removed": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}