Email Blocks
Get Email Block Type
Get the full field reference for one email block type.
GET
/
api
/
v1
/
email-blocks
/
{type}
Get Email Block Type
curl --request GET \
--url https://api.sequenzy.com/api/v1/email-blocks/{type} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/email-blocks/{type}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/email-blocks/{type}', 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/email-blocks/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/email-blocks/{type}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequenzy.com/api/v1/email-blocks/{type}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/email-blocks/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"blockType": {
"type": "steps",
"creatable": true,
"required": ["items", "variant"],
"optional": ["id", "accentColor", "styles", "conditions"],
"fields": [
{
"name": "items",
"required": true,
"type": "array",
"itemFields": [
{ "name": "id", "required": false, "type": "string" },
{ "name": "title", "required": true, "type": "string" },
{ "name": "description", "required": false, "type": "string" }
]
},
{
"name": "variant",
"required": true,
"type": "enum",
"values": ["numbered", "timeline"]
},
{ "name": "accentColor", "required": false, "type": "string" }
],
"example": {
"type": "steps",
"variant": "timeline",
"items": [
{ "title": "Connect", "description": "Link your account." },
{ "title": "Launch", "description": "Send your first campaign." }
]
}
},
"conditionFields": [
{
"field": "tag",
"label": "Tag",
"operators": ["contains", "not_contains", "is_empty", "is_not_empty"],
"valueFormat": "One tag name, such as \"extended\".",
"serverEvaluated": true,
"previewSupport": "inline_tags_or_stored_subscriber",
"example": {
"id": "c1",
"field": "tag",
"operator": "contains",
"value": "extended"
}
}
]
}
{
"success": false,
"error": "Invalid API key"
}
{
"success": false,
"error": "Unknown block type: numbered-list. Valid block types: text, html, heading, list, button, ..."
}
Get Email Block Type
You can read the complete field reference for a single block type, including a minimal valid example and authoring notes. Each entry infields describes one field. An array field carries itemFields with the shape of one entry, and an object field carries its own fields - so GET /api/v1/email-blocks/repeat returns the mode, strategy, lookbackDays, sort, and filters a productSource accepts, with the allowed values of each.
The response carries conditionFields, the per-field table for block conditions, when you request conditional-group or pass ?conditionFields=true. Any other type returns conditionFieldsHint instead, because the table is several times the size of one block type’s reference and a targeted lookup should stay small. See List Email Block Types.
curl "https://api.sequenzy.com/api/v1/email-blocks/text?conditionFields=true" \
-H "Authorization: Bearer API_KEY"
Request
string
required
Block type, for example
list, steps, text, or hero.string
Pass
true to include the per-field condition table. Not needed for
conditional-group, which always carries it.curl "https://api.sequenzy.com/api/v1/email-blocks/steps?conditionFields=true" \
-H "Authorization: Bearer API_KEY"
Responses
{
"success": true,
"blockType": {
"type": "steps",
"creatable": true,
"required": ["items", "variant"],
"optional": ["id", "accentColor", "styles", "conditions"],
"fields": [
{
"name": "items",
"required": true,
"type": "array",
"itemFields": [
{ "name": "id", "required": false, "type": "string" },
{ "name": "title", "required": true, "type": "string" },
{ "name": "description", "required": false, "type": "string" }
]
},
{
"name": "variant",
"required": true,
"type": "enum",
"values": ["numbered", "timeline"]
},
{ "name": "accentColor", "required": false, "type": "string" }
],
"example": {
"type": "steps",
"variant": "timeline",
"items": [
{ "title": "Connect", "description": "Link your account." },
{ "title": "Launch", "description": "Send your first campaign." }
]
}
},
"conditionFields": [
{
"field": "tag",
"label": "Tag",
"operators": ["contains", "not_contains", "is_empty", "is_not_empty"],
"valueFormat": "One tag name, such as \"extended\".",
"serverEvaluated": true,
"previewSupport": "inline_tags_or_stored_subscriber",
"example": {
"id": "c1",
"field": "tag",
"operator": "contains",
"value": "extended"
}
}
]
}
{
"success": false,
"error": "Invalid API key"
}
{
"success": false,
"error": "Unknown block type: numbered-list. Valid block types: text, html, heading, list, button, ..."
}
Related
⌘I
Get Email Block Type
curl --request GET \
--url https://api.sequenzy.com/api/v1/email-blocks/{type} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/email-blocks/{type}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/email-blocks/{type}', 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/email-blocks/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/email-blocks/{type}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequenzy.com/api/v1/email-blocks/{type}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/email-blocks/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"blockType": {
"type": "steps",
"creatable": true,
"required": ["items", "variant"],
"optional": ["id", "accentColor", "styles", "conditions"],
"fields": [
{
"name": "items",
"required": true,
"type": "array",
"itemFields": [
{ "name": "id", "required": false, "type": "string" },
{ "name": "title", "required": true, "type": "string" },
{ "name": "description", "required": false, "type": "string" }
]
},
{
"name": "variant",
"required": true,
"type": "enum",
"values": ["numbered", "timeline"]
},
{ "name": "accentColor", "required": false, "type": "string" }
],
"example": {
"type": "steps",
"variant": "timeline",
"items": [
{ "title": "Connect", "description": "Link your account." },
{ "title": "Launch", "description": "Send your first campaign." }
]
}
},
"conditionFields": [
{
"field": "tag",
"label": "Tag",
"operators": ["contains", "not_contains", "is_empty", "is_not_empty"],
"valueFormat": "One tag name, such as \"extended\".",
"serverEvaluated": true,
"previewSupport": "inline_tags_or_stored_subscriber",
"example": {
"id": "c1",
"field": "tag",
"operator": "contains",
"value": "extended"
}
}
]
}
{
"success": false,
"error": "Invalid API key"
}
{
"success": false,
"error": "Unknown block type: numbered-list. Valid block types: text, html, heading, list, button, ..."
}