Emails
Create Email
Create an email template with block content.
POST
/
api
/
v1
/
emails
Create Email
curl --request POST \
--url https://api.sequenzy.com/api/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/emails"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [{}]
}
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>',
previewText: {},
html: '<string>',
blocks: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/emails', 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://api.sequenzy.com/api/v1/emails",
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>',
'previewText' => [
],
'html' => '<string>',
'blocks' => [
[
]
]
]),
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.sequenzy.com/api/v1/emails"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\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://api.sequenzy.com/api/v1/emails")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/emails")
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 \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"email": {
"id": "email_123",
"companyId": "company_123",
"name": "Welcome",
"subject": "Welcome",
"previewText": null,
"blocks": [{ "id": "block_123", "type": "text", "variant": "html", "content": "<h1>Hello</h1>" }],
"createdAt": "2026-04-19T12:00:00.000Z",
"updatedAt": "2026-04-19T12:00:00.000Z"
}
}
{
"success": false,
"error": "emails.create: provide either html or blocks, not both."
}
{
"success": false,
"error": "Missing API key. Provide via x-api-key header or Authorization: Bearer <key>"
}
{ "success": false, "error": "No company selected" }
{ "success": false, "error": "Internal server error" }
You can create an email template with either raw HTML or structured blocks. Raw HTML is stored as a native HTML body.
Request
Structured email blocks. Provide either
blocks or html, not both. Put
block styling under styles; top-level style keys like backgroundColor,
backgroundOpacity, textColor, textAlign, borderColor, borderWidth,
and borderRadius are normalized into styles.curl -X POST "https://api.sequenzy.com/api/v1/emails" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Welcome","subject":"Welcome","html":"<h1>Hello</h1>"}'
Responses
{
"success": true,
"email": {
"id": "email_123",
"companyId": "company_123",
"name": "Welcome",
"subject": "Welcome",
"previewText": null,
"blocks": [{ "id": "block_123", "type": "text", "variant": "html", "content": "<h1>Hello</h1>" }],
"createdAt": "2026-04-19T12:00:00.000Z",
"updatedAt": "2026-04-19T12:00:00.000Z"
}
}
{
"success": false,
"error": "emails.create: provide either html or blocks, not both."
}
{
"success": false,
"error": "Missing API key. Provide via x-api-key header or Authorization: Bearer <key>"
}
{ "success": false, "error": "No company selected" }
{ "success": false, "error": "Internal server error" }
⌘I
Create Email
curl --request POST \
--url https://api.sequenzy.com/api/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/emails"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [{}]
}
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>',
previewText: {},
html: '<string>',
blocks: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/emails', 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://api.sequenzy.com/api/v1/emails",
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>',
'previewText' => [
],
'html' => '<string>',
'blocks' => [
[
]
]
]),
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.sequenzy.com/api/v1/emails"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\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://api.sequenzy.com/api/v1/emails")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/emails")
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 \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"email": {
"id": "email_123",
"companyId": "company_123",
"name": "Welcome",
"subject": "Welcome",
"previewText": null,
"blocks": [{ "id": "block_123", "type": "text", "variant": "html", "content": "<h1>Hello</h1>" }],
"createdAt": "2026-04-19T12:00:00.000Z",
"updatedAt": "2026-04-19T12:00:00.000Z"
}
}
{
"success": false,
"error": "emails.create: provide either html or blocks, not both."
}
{
"success": false,
"error": "Missing API key. Provide via x-api-key header or Authorization: Bearer <key>"
}
{ "success": false, "error": "No company selected" }
{ "success": false, "error": "Internal server error" }