PATCH
/
v1
/
tenant
/
{tenant_id}
/
category
/
{category_slug}
/
Update Tenant Default Preference
curl --request PATCH \
  --url https://hub.suprsend.com/v1/tenant/{tenant_id}/category/{category_slug}/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "preference": "opt_in",
  "visible_to_subscriber": true,
  "mandatory_channels": [
    "<string>"
  ]
}'
{
  "name": "Status Update Alert",
  "category": "status-update-alert",
  "description": "Send me updates when account status changes",
  "root_category": "transactional",
  "default_preference": "opt_in",
  "default_mandatory_channels": null,
  "visible_to_subscriber": true,
  "preference": "opt_in",
  "mandatory_channels": null,
  "blocked_channels": null
}

Authorizations

Authorization
string
header
required

Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.

Path Parameters

tenant_id
string
required

unique identifier of the brand/tenant you want to update default preferences for

category_slug
string
required

notification category slug. You can get this from Notification Categories page on SuprSend dashboard -> Settings page

Body

application/json
preference
string
default:opt_in

set **opt_in** to send notifications on all channels by default <br> set **opt_out** to not send notifications in this category by default. For instance, newsletter <br> set **cant_unsubscribe**if you do not want users to completely opt-out from this category. Notifications will always be sent on mandatory channels in this category.

visible_to_subscriber
boolean

set it false to hide a category from user's preference page

mandatory_channels
string[]

Add mandatory channels that the user can't unsubscribe from if preference is cant_unsubscribe. Add channels as email, sms, whatsapp, androidpush, inbox, iospush, slack, webpush

Response

202

name
string

preference category name

category
string

unique preference category slug. You can get it by clicking on category name on SuprSend dashboard -> preference page

description
string
root_category
string

root category this sub-category belongs to

Example:

"transactional"

default_preference
enum<string>

default preference of the category

Available options:
cant_unsubscribe,
opt_in,
opt_out
mandatory_channels
string[]

mandatory channels in case default preference is can't unsubscribe

visible_to_subscriber
boolean

set it false to hide a category from user's preference page

preference
enum<string>
Available options:
opt_in,
opt_out
blocked_channels
string[]

channels blocked in the category from SuprSend dashboard -> tenants page