Create or Update Preference Category
Use this API to set preference categories to be used in workflow or to show on user preference page.
curl -X POST "https://management-api.suprsend.com/v1/{workspace}/preference_category/?commit=false" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json" \
--data '{
"root_categories": [
{
"root_category": "system"
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status Update or mentions on tasks assigned by me or tagged to me",
"default_preference": "opt_in",
"digest_schedule": {
"enabled": true,
"options": [
{
"id": "instant",
"label": "Instant",
"frequency": "instantly",
"is_default": true
},
{
"id": "daily-digest",
"label": "Daily at 9:00 AM",
"frequency": "daily",
"interval": 1,
"time": { "edit_policy": "editable", "default_value": "09:00" },
"is_default": false
}
]
},
"properties": [
{
"key": "threshold",
"label": "Threshold",
"value_type": "integer",
"is_optional": false,
"default_value": 10,
"edit_policy": "editable"
}
]
}
]
}
]
},
{
"root_category": "promotional",
"sections": [
{
"name": "Product Updates",
"categories": [
{
"category": "newsletter",
"name": "Newsletter",
"default_preference": "opt_out",
"digest_schedule": null,
"properties": null
}
]
}
]
}
]
}'import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/"
payload = { "root_categories": [{ "sections": [
{
"name": "<string>",
"description": "<string>",
"tags": ["<string>"],
"categories": [
{
"name": "<string>",
"description": "<string>",
"default_mandatory_channels": [],
"default_opt_in_channels": [],
"tags": ["<string>"],
"digest_schedule": {
"enabled": True,
"options": [
{
"id": "<string>",
"label": "<string>",
"interval": 2,
"time": { "default_value": "00:00" },
"weekdays": { "default_value": [] },
"monthdays": { "default_value": [{ "pos": 123 }] },
"dtstart": { "default_value": "2026-06-20T00:00:00Z" },
"is_default": True
}
]
},
"properties": [
{
"key": "<string>",
"label": "<string>",
"is_optional": False,
"choices": [
{
"value": "<string>",
"label": "<string>"
}
],
"default_value": "<unknown>",
"dynamic_choices_key": "<string>"
}
]
}
]
}
] }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
root_categories: [
{
sections: [
{
name: '<string>',
description: '<string>',
tags: ['<string>'],
categories: [
{
name: '<string>',
description: '<string>',
default_mandatory_channels: [],
default_opt_in_channels: [],
tags: ['<string>'],
digest_schedule: {
enabled: true,
options: [
{
id: '<string>',
label: '<string>',
interval: 2,
time: {default_value: '00:00'},
weekdays: {default_value: []},
monthdays: {default_value: [{pos: 123}]},
dtstart: {default_value: '2026-06-20T00:00:00Z'},
is_default: true
}
]
},
properties: [
{
key: '<string>',
label: '<string>',
is_optional: false,
choices: [{value: '<string>', label: '<string>'}],
default_value: '<unknown>',
dynamic_choices_key: '<string>'
}
]
}
]
}
]
}
]
})
};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'root_categories' => [
[
'sections' => [
[
'name' => '<string>',
'description' => '<string>',
'tags' => [
'<string>'
],
'categories' => [
[
'name' => '<string>',
'description' => '<string>',
'default_mandatory_channels' => [
],
'default_opt_in_channels' => [
],
'tags' => [
'<string>'
],
'digest_schedule' => [
'enabled' => true,
'options' => [
[
'id' => '<string>',
'label' => '<string>',
'interval' => 2,
'time' => [
'default_value' => '00:00'
],
'weekdays' => [
'default_value' => [
]
],
'monthdays' => [
'default_value' => [
[
'pos' => 123
]
]
],
'dtstart' => [
'default_value' => '2026-06-20T00:00:00Z'
],
'is_default' => true
]
]
],
'properties' => [
[
'key' => '<string>',
'label' => '<string>',
'is_optional' => false,
'choices' => [
[
'value' => '<string>',
'label' => '<string>'
]
],
'default_value' => '<unknown>',
'dynamic_choices_key' => '<string>'
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://management-api.suprsend.com/v1/{workspace}/preference_category/"
payload := strings.NewReader("{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://management-api.suprsend.com/v1/{workspace}/preference_category/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/preference_category/v1/schema.json",
"root_categories": [
{
"root_category": "system",
"sections": []
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status Update 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": {
"enabled": true,
"options": [
{
"id": "instant",
"label": "Instant",
"frequency": "instantly",
"is_default": true
},
{
"id": "daily-digest",
"label": "Daily at 9:00 AM",
"frequency": "daily",
"interval": 1,
"time": {
"edit_policy": "editable",
"default_value": "09:00"
},
"is_default": false
}
]
},
"properties": [
{
"key": "priority",
"label": "Minimum priority",
"value_type": "string_choice",
"is_optional": false,
"choices": [
{
"value": "low",
"label": "Low"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "high",
"label": "High"
}
],
"default_value": "high",
"edit_policy": "editable"
}
]
}
]
}
]
},
{
"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": 3,
"status": "draft",
"commit_message": null,
"committed_at": null,
"validation_result": {
"is_valid": true
}
}{
"code": 401,
"message": "Unauthorized"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}You can read more about preference categories here.
Note:
Changes will only be pushed if "validation_result":{"is_valid":true} in the response. General reasons for validation failure are:
- There are multiple categories with the same slug
- Some subcategories have been deleted in this version, on which active workflows are configured
- You’ve not passed all three categories in the request body - system, transactional, promotional
Authorizations
Pass as Authorization: ServiceToken <token>. You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
Workspace slug (staging, production, etc.)
Query Parameters
Whether to commit changes immediately. Set to true to make changes live, false to save as draft.
Optional commit message describing the changes made. Used only when commit=true.
Body
Array of root preference categories. Exactly three entries are required, one for each root category (system, transactional, promotional), even if empty.
3 elementsShow child attributes
Show child attributes
Response
Successfully created/updated preference category draft
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 "draft"
Version number field as an identifier to track the version
3
Commit message describing the changes that were made
null
Timestamp when the changes were committed
null
Result of validating the preference category
Show child attributes
Show child attributes
Present only when commit=true is passed. is_committed is false if validation failed or the commit raised an error; the draft is still saved.
Show child attributes
Show child attributes
Was this page helpful?
curl -X POST "https://management-api.suprsend.com/v1/{workspace}/preference_category/?commit=false" \
--header "Authorization: ServiceToken {token}" \
--header "Content-Type: application/json" \
--data '{
"root_categories": [
{
"root_category": "system"
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status Update or mentions on tasks assigned by me or tagged to me",
"default_preference": "opt_in",
"digest_schedule": {
"enabled": true,
"options": [
{
"id": "instant",
"label": "Instant",
"frequency": "instantly",
"is_default": true
},
{
"id": "daily-digest",
"label": "Daily at 9:00 AM",
"frequency": "daily",
"interval": 1,
"time": { "edit_policy": "editable", "default_value": "09:00" },
"is_default": false
}
]
},
"properties": [
{
"key": "threshold",
"label": "Threshold",
"value_type": "integer",
"is_optional": false,
"default_value": 10,
"edit_policy": "editable"
}
]
}
]
}
]
},
{
"root_category": "promotional",
"sections": [
{
"name": "Product Updates",
"categories": [
{
"category": "newsletter",
"name": "Newsletter",
"default_preference": "opt_out",
"digest_schedule": null,
"properties": null
}
]
}
]
}
]
}'import requests
url = "https://management-api.suprsend.com/v1/{workspace}/preference_category/"
payload = { "root_categories": [{ "sections": [
{
"name": "<string>",
"description": "<string>",
"tags": ["<string>"],
"categories": [
{
"name": "<string>",
"description": "<string>",
"default_mandatory_channels": [],
"default_opt_in_channels": [],
"tags": ["<string>"],
"digest_schedule": {
"enabled": True,
"options": [
{
"id": "<string>",
"label": "<string>",
"interval": 2,
"time": { "default_value": "00:00" },
"weekdays": { "default_value": [] },
"monthdays": { "default_value": [{ "pos": 123 }] },
"dtstart": { "default_value": "2026-06-20T00:00:00Z" },
"is_default": True
}
]
},
"properties": [
{
"key": "<string>",
"label": "<string>",
"is_optional": False,
"choices": [
{
"value": "<string>",
"label": "<string>"
}
],
"default_value": "<unknown>",
"dynamic_choices_key": "<string>"
}
]
}
]
}
] }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
root_categories: [
{
sections: [
{
name: '<string>',
description: '<string>',
tags: ['<string>'],
categories: [
{
name: '<string>',
description: '<string>',
default_mandatory_channels: [],
default_opt_in_channels: [],
tags: ['<string>'],
digest_schedule: {
enabled: true,
options: [
{
id: '<string>',
label: '<string>',
interval: 2,
time: {default_value: '00:00'},
weekdays: {default_value: []},
monthdays: {default_value: [{pos: 123}]},
dtstart: {default_value: '2026-06-20T00:00:00Z'},
is_default: true
}
]
},
properties: [
{
key: '<string>',
label: '<string>',
is_optional: false,
choices: [{value: '<string>', label: '<string>'}],
default_value: '<unknown>',
dynamic_choices_key: '<string>'
}
]
}
]
}
]
}
]
})
};
fetch('https://management-api.suprsend.com/v1/{workspace}/preference_category/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'root_categories' => [
[
'sections' => [
[
'name' => '<string>',
'description' => '<string>',
'tags' => [
'<string>'
],
'categories' => [
[
'name' => '<string>',
'description' => '<string>',
'default_mandatory_channels' => [
],
'default_opt_in_channels' => [
],
'tags' => [
'<string>'
],
'digest_schedule' => [
'enabled' => true,
'options' => [
[
'id' => '<string>',
'label' => '<string>',
'interval' => 2,
'time' => [
'default_value' => '00:00'
],
'weekdays' => [
'default_value' => [
]
],
'monthdays' => [
'default_value' => [
[
'pos' => 123
]
]
],
'dtstart' => [
'default_value' => '2026-06-20T00:00:00Z'
],
'is_default' => true
]
]
],
'properties' => [
[
'key' => '<string>',
'label' => '<string>',
'is_optional' => false,
'choices' => [
[
'value' => '<string>',
'label' => '<string>'
]
],
'default_value' => '<unknown>',
'dynamic_choices_key' => '<string>'
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://management-api.suprsend.com/v1/{workspace}/preference_category/"
payload := strings.NewReader("{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://management-api.suprsend.com/v1/{workspace}/preference_category/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/preference_category/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"root_categories\": [\n {\n \"sections\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"default_mandatory_channels\": [],\n \"default_opt_in_channels\": [],\n \"tags\": [\n \"<string>\"\n ],\n \"digest_schedule\": {\n \"enabled\": true,\n \"options\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"interval\": 2,\n \"time\": {\n \"default_value\": \"00:00\"\n },\n \"weekdays\": {\n \"default_value\": []\n },\n \"monthdays\": {\n \"default_value\": [\n {\n \"pos\": 123\n }\n ]\n },\n \"dtstart\": {\n \"default_value\": \"2026-06-20T00:00:00Z\"\n },\n \"is_default\": true\n }\n ]\n },\n \"properties\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"is_optional\": false,\n \"choices\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"default_value\": \"<unknown>\",\n \"dynamic_choices_key\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"$schema": "https://schema.suprsend.com/preference_category/v1/schema.json",
"root_categories": [
{
"root_category": "system",
"sections": []
},
{
"root_category": "transactional",
"sections": [
{
"name": "Task Updates",
"description": null,
"tags": null,
"categories": [
{
"category": "tagged-to-me",
"name": "Tagged to Me",
"description": "Status Update 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": {
"enabled": true,
"options": [
{
"id": "instant",
"label": "Instant",
"frequency": "instantly",
"is_default": true
},
{
"id": "daily-digest",
"label": "Daily at 9:00 AM",
"frequency": "daily",
"interval": 1,
"time": {
"edit_policy": "editable",
"default_value": "09:00"
},
"is_default": false
}
]
},
"properties": [
{
"key": "priority",
"label": "Minimum priority",
"value_type": "string_choice",
"is_optional": false,
"choices": [
{
"value": "low",
"label": "Low"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "high",
"label": "High"
}
],
"default_value": "high",
"edit_policy": "editable"
}
]
}
]
}
]
},
{
"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": 3,
"status": "draft",
"commit_message": null,
"committed_at": null,
"validation_result": {
"is_valid": true
}
}{
"code": 401,
"message": "Unauthorized"
}{
"code": 404,
"message": "workspace not found for slug/uid: workspace"
}