CATEGORIES
Commit Preference Category
Commit draft changes to the preference category to make them live
PATCH
/
v1
/
{workspace}
/
preference_category
/
commit
/
Commit Category
curl -X PATCH "https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/?commit_message=Added%20password-reset%20category" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json"import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/"
headers = {"Authorization": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/', 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://management-api.suprsend.com/v1/{workspace}/preference_category/commit/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://management-api.suprsend.com/v1/{workspace}/preference_category/commit/"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/preference_category/v1/schema.json",
"root_categories": [
{
"root_category": "system",
"sections": [
{
"name": "Alerts",
"description": null,
"tags": null,
"categories": [
{
"category": "critical-updates",
"name": "Critical Updates",
"description": "Important system alerts requiring immediate attention",
"default_preference": "opt_in",
"is_commercial": false,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status updates or mentions on tasks assigned by me or tagged to me",
"default_preference": "opt_in",
"is_commercial": false,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
},
{
"root_category": "promotional",
"sections": [
{
"name": "Product Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "newsletter",
"name": "Newsletter",
"description": null,
"default_preference": "opt_out",
"is_commercial": true,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
}
],
"version_no": 2,
"status": "active",
"commit_message": "Added password-reset category",
"committed_at": "2025-10-03T09:52:55.273317+00:00"
}{
"code": 401,
"message": "ServiceToken not found"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}{
"code": 409,
"message": "no changes to publish"
}Authorizations
Pass as Authorization: ServiceToken <token>. You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Response
Successfully committed preference category
⌘I
Commit Category
curl -X PATCH "https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/?commit_message=Added%20password-reset%20category" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json"import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/"
headers = {"Authorization": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/', 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://management-api.suprsend.com/v1/{workspace}/preference_category/commit/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://management-api.suprsend.com/v1/{workspace}/preference_category/commit/"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/commit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/preference_category/v1/schema.json",
"root_categories": [
{
"root_category": "system",
"sections": [
{
"name": "Alerts",
"description": null,
"tags": null,
"categories": [
{
"category": "critical-updates",
"name": "Critical Updates",
"description": "Important system alerts requiring immediate attention",
"default_preference": "opt_in",
"is_commercial": false,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status updates or mentions on tasks assigned by me or tagged to me",
"default_preference": "opt_in",
"is_commercial": false,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
},
{
"root_category": "promotional",
"sections": [
{
"name": "Product Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "newsletter",
"name": "Newsletter",
"description": null,
"default_preference": "opt_out",
"is_commercial": true,
"default_mandatory_channels": null,
"default_opt_in_channels": null,
"tags": null,
"digest_schedule": null,
"properties": null
}
]
}
]
}
],
"version_no": 2,
"status": "active",
"commit_message": "Added password-reset category",
"committed_at": "2025-10-03T09:52:55.273317+00:00"
}{
"code": 401,
"message": "ServiceToken not found"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}{
"code": 409,
"message": "no changes to publish"
}