Transactional
Update Transactional Email
Update transactional email metadata or body content
PATCH
/
api
/
v1
/
transactional
/
{idOrSlug}
Update Transactional Email
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/transactional/{idOrSlug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/transactional/{idOrSlug}"
payload = {
"name": "<string>",
"enabled": True,
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
subject: '<string>',
previewText: '<string>',
html: '<string>',
blocks: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/transactional/{idOrSlug}', 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/transactional/{idOrSlug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'enabled' => true,
'subject' => '<string>',
'previewText' => '<string>',
'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/transactional/{idOrSlug}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/transactional/{idOrSlug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/transactional/{idOrSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"transactional": {
"id": "txn_abc123",
"name": "Welcome Email",
"slug": "welcome",
"emailId": "email_abc123",
"enabled": true,
"subject": "Welcome, {{NAME}}",
"previewText": "Your account is ready.",
"blocks": [
{
"id": "block_123",
"type": "text",
"content": "<p>Welcome to {{COMPANY_NAME}}</p>",
"variant": "html"
}
],
"variables": ["NAME", "COMPANY_NAME"],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:35:00Z"
}
}
{
"success": false,
"error": "Provide at least one of name, enabled, subject, previewText, html, or blocks."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Transactional email \"welcome\" not found"
}
{
"success": false,
"error": "Internal server error"
}
Update a transactional email by ID or slug. You can update metadata like
name and enabled, or replace the linked email body with html or blocks.
Path Parameters
string
required
Transactional email ID or slug
Request
string
Transactional email name
boolean
Whether this transactional email can be sent
string
Email subject line
string
Email preview text
string
Raw HTML body. Provide either
html or blocks, not both.array
Sequenzy email blocks. Provide either
blocks or html, not both. Put block
styling under styles; top-level style keys like backgroundColor,
backgroundOpacity, borderColor, borderWidth, and borderRadius are
normalized into styles.curl -X PATCH "https://api.sequenzy.com/api/v1/transactional/welcome" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Welcome, {{NAME}}",
"html": "<p>Welcome to {{COMPANY_NAME}}</p>"
}'
Responses
{
"success": true,
"transactional": {
"id": "txn_abc123",
"name": "Welcome Email",
"slug": "welcome",
"emailId": "email_abc123",
"enabled": true,
"subject": "Welcome, {{NAME}}",
"previewText": "Your account is ready.",
"blocks": [
{
"id": "block_123",
"type": "text",
"content": "<p>Welcome to {{COMPANY_NAME}}</p>",
"variant": "html"
}
],
"variables": ["NAME", "COMPANY_NAME"],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:35:00Z"
}
}
{
"success": false,
"error": "Provide at least one of name, enabled, subject, previewText, html, or blocks."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Transactional email \"welcome\" not found"
}
{
"success": false,
"error": "Internal server error"
}
⌘I
Update Transactional Email
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/transactional/{idOrSlug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/transactional/{idOrSlug}"
payload = {
"name": "<string>",
"enabled": True,
"subject": "<string>",
"previewText": "<string>",
"html": "<string>",
"blocks": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
subject: '<string>',
previewText: '<string>',
html: '<string>',
blocks: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/transactional/{idOrSlug}', 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/transactional/{idOrSlug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'enabled' => true,
'subject' => '<string>',
'previewText' => '<string>',
'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/transactional/{idOrSlug}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/transactional/{idOrSlug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/transactional/{idOrSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"html\": \"<string>\",\n \"blocks\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"transactional": {
"id": "txn_abc123",
"name": "Welcome Email",
"slug": "welcome",
"emailId": "email_abc123",
"enabled": true,
"subject": "Welcome, {{NAME}}",
"previewText": "Your account is ready.",
"blocks": [
{
"id": "block_123",
"type": "text",
"content": "<p>Welcome to {{COMPANY_NAME}}</p>",
"variant": "html"
}
],
"variables": ["NAME", "COMPANY_NAME"],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:35:00Z"
}
}
{
"success": false,
"error": "Provide at least one of name, enabled, subject, previewText, html, or blocks."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Transactional email \"welcome\" not found"
}
{
"success": false,
"error": "Internal server error"
}