Notification Preferences
Update Notification Preferences
Change your account notification settings for the current company
PATCH
/
api
/
v1
/
notification-preferences
Update Notification Preferences
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"notificationPreferences": [
{}
],
"notificationPreferences[].event": "<string>",
"notificationPreferences[].mode": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/notification-preferences"
payload = {
"notificationPreferences": [{}],
"notificationPreferences[].event": "<string>",
"notificationPreferences[].mode": "<string>"
}
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({
notificationPreferences: [{}],
'notificationPreferences[].event': '<string>',
'notificationPreferences[].mode': '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/notification-preferences', 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/notification-preferences",
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([
'notificationPreferences' => [
[
]
],
'notificationPreferences[].event' => '<string>',
'notificationPreferences[].mode' => '<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://api.sequenzy.com/api/v1/notification-preferences"
payload := strings.NewReader("{\n \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\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/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/notification-preferences")
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 \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"notificationPreferences": [
{ "event": "new_subscriber", "mode": "daily" },
{ "event": "campaign_completed", "mode": "instant" }
],
"supportedModes": {
"new_subscriber": ["off", "instant", "daily"],
"campaign_completed": ["off", "instant"]
},
"defaults": {
"new_subscriber": "off",
"campaign_completed": "off"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "\"daily\" is not a supported mode for the campaign_completed notification."
}
}
{
"success": false,
"error": { "code": "UNAUTHORIZED", "message": "Invalid API key" }
}
Change which account notifications Sequenzy emails you about this workspace.
This endpoint requires the
companies:manage scope. Reading the current values
only requires account:read.
Events you do not include keep their current value. The response returns the full set either way, so you never have to merge state yourself.
This endpoint always acts on the API key’s own user and can never change a teammate’s settings.
Request
array
required
Preferences to set. Must contain at least one entry.
string
required
new_subscriber or campaign_completed.string
required
off, instant, or daily. daily is not valid for campaign_completed -
a campaign finishes once, so there is nothing to roll up.curl -X PATCH "https://api.sequenzy.com/api/v1/notification-preferences" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"notificationPreferences": [{"event": "new_subscriber", "mode": "daily"}]}'
Responses
{
"success": true,
"notificationPreferences": [
{ "event": "new_subscriber", "mode": "daily" },
{ "event": "campaign_completed", "mode": "instant" }
],
"supportedModes": {
"new_subscriber": ["off", "instant", "daily"],
"campaign_completed": ["off", "instant"]
},
"defaults": {
"new_subscriber": "off",
"campaign_completed": "off"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "\"daily\" is not a supported mode for the campaign_completed notification."
}
}
{
"success": false,
"error": { "code": "UNAUTHORIZED", "message": "Invalid API key" }
}
Before a bulk import
You do not need to turn notifications off before importing contacts. Imports never trigger new-subscriber notifications, and a high-volume day of real signups automatically falls back to a daily summary. See Account Notifications.Previous
Create SubscriberCreate a new subscriber or update an existing one based on duplicate strategy
Next
⌘I
Update Notification Preferences
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"notificationPreferences": [
{}
],
"notificationPreferences[].event": "<string>",
"notificationPreferences[].mode": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/notification-preferences"
payload = {
"notificationPreferences": [{}],
"notificationPreferences[].event": "<string>",
"notificationPreferences[].mode": "<string>"
}
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({
notificationPreferences: [{}],
'notificationPreferences[].event': '<string>',
'notificationPreferences[].mode': '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/notification-preferences', 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/notification-preferences",
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([
'notificationPreferences' => [
[
]
],
'notificationPreferences[].event' => '<string>',
'notificationPreferences[].mode' => '<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://api.sequenzy.com/api/v1/notification-preferences"
payload := strings.NewReader("{\n \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\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/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/notification-preferences")
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 \"notificationPreferences\": [\n {}\n ],\n \"notificationPreferences[].event\": \"<string>\",\n \"notificationPreferences[].mode\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"notificationPreferences": [
{ "event": "new_subscriber", "mode": "daily" },
{ "event": "campaign_completed", "mode": "instant" }
],
"supportedModes": {
"new_subscriber": ["off", "instant", "daily"],
"campaign_completed": ["off", "instant"]
},
"defaults": {
"new_subscriber": "off",
"campaign_completed": "off"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "\"daily\" is not a supported mode for the campaign_completed notification."
}
}
{
"success": false,
"error": { "code": "UNAUTHORIZED", "message": "Invalid API key" }
}