Commit Preference Category
Commit draft changes to the preference category to make them live
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 = {"ServiceToken <token>": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'ServiceToken <token>': '<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 => [
"ServiceToken <token>: <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("ServiceToken <token>", "<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("ServiceToken <token>", "<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["ServiceToken <token>"] = '<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",
"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",
"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",
"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"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
Workspace slug (staging, production, etc.)
Query Parameters
Commit message describing the changes being made live.
Response
Successfully committed preference category
JSON schema reference for preference category structure
"https://schema.suprsend.com/preference_category/v1/schema.json"
Array of root preference categories
Show child attributes
Show child attributes
Current status of the preference category
draft, active "active"
Version number field as an identifier to track the version
2
Commit message describing the changes that were made live
"Added password-reset category"
Timestamp when the changes were committed
"2025-10-03T09:52:55.273317+00:00"
Was this page helpful?
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 = {"ServiceToken <token>": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'ServiceToken <token>': '<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 => [
"ServiceToken <token>: <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("ServiceToken <token>", "<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("ServiceToken <token>", "<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["ServiceToken <token>"] = '<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",
"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",
"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",
"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"
}