Templates
Update Template
Update an email template
PUT
/
api
/
v1
/
templates
/
{templateId}
Update Template
curl --request PUT \
--url https://api.sequenzy.com/api/v1/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [
{}
],
"labels": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/templates/{templateId}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [{}],
"labels": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
previewText: {},
html: '<string>',
blocks: [{}],
labels: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/templates/{templateId}', 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/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'previewText' => [
],
'html' => '<string>',
'blocks' => [
[
]
],
'labels' => [
[
]
]
]),
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/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/templates/{templateId}")
.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 \"labels\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"labels\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"template": {
"id": "email_abc123",
"name": "[Template] Welcome",
"subject": "Welcome to Acme",
"previewText": "Everything you need to get started",
"labels": ["edm"]
}
}
{
"success": false,
"error": "Provide at least one of: name, subject, previewText, html, blocks, labels."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Template not found"
}
{
"success": false,
"error": "Failed to update template"
}
Update template metadata, labels, or content. You can pass an email template ID; transactional email IDs and slugs are also resolved for compatibility.
Request
string
required
Template ID, transactional email ID, or transactional slug.
string
Updated template name.
string
Updated email subject line.
string | null
Updated inbox preview text. Send
null to clear it.string
Replacement HTML body. Use this or
blocks, not both.array
Replacement Sequenzy email blocks. Use this or
html, not both. Put block
styling under styles; top-level style keys like backgroundColor,
backgroundOpacity, borderColor, borderWidth, and borderRadius are
normalized into styles.array
Replacement label names. Send an empty array to clear labels. Missing labels
are created automatically. The API also accepts
label as a compatibility
alias.curl -X PUT "https://api.sequenzy.com/api/v1/templates/email_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject": "Welcome to Acme", "previewText": "Everything you need to get started", "labels": ["edm"]}'
Responses
{
"success": true,
"template": {
"id": "email_abc123",
"name": "[Template] Welcome",
"subject": "Welcome to Acme",
"previewText": "Everything you need to get started",
"labels": ["edm"]
}
}
{
"success": false,
"error": "Provide at least one of: name, subject, previewText, html, blocks, labels."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Template not found"
}
{
"success": false,
"error": "Failed to update template"
}
⌘I
Update Template
curl --request PUT \
--url https://api.sequenzy.com/api/v1/templates/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [
{}
],
"labels": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/templates/{templateId}"
payload = {
"name": "<string>",
"subject": "<string>",
"previewText": {},
"html": "<string>",
"blocks": [{}],
"labels": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject: '<string>',
previewText: {},
html: '<string>',
blocks: [{}],
labels: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/templates/{templateId}', 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/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'subject' => '<string>',
'previewText' => [
],
'html' => '<string>',
'blocks' => [
[
]
],
'labels' => [
[
]
]
]),
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/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": {},\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/templates/{templateId}")
.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 \"labels\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"labels\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"template": {
"id": "email_abc123",
"name": "[Template] Welcome",
"subject": "Welcome to Acme",
"previewText": "Everything you need to get started",
"labels": ["edm"]
}
}
{
"success": false,
"error": "Provide at least one of: name, subject, previewText, html, blocks, labels."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Template not found"
}
{
"success": false,
"error": "Failed to update template"
}