Skip to main content
PATCH
/
v1
/
tenant
/
{tenant_id}
/
category
/
{category_slug}
Update Tenant Default Preference
curl -X PATCH "https://hub.suprsend.com/v1/tenant/brand_id/preference/status-update-alert/" \
  --header 'Authorization: Bearer __YOUR_API_KEY__' \
  --header 'Content-Type: application/json' \
  --data '{
    "preference": "opt_in",
    "visible_to_subscriber": true
  }'
{
  "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,
  "default_opt_in_channels": [
    "email",
    "sms"
  ],
  "visible_to_subscriber": true,
  "preference": "opt_in",
  "mandatory_channels": null,
  "opt_in_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
enum<string>

set **opt_in** to turn on notifications on all or selected channels by default, **opt_out** to turn-off notifications by default, **cant_unsubscribe**if you do not want users to completely opt-out from this category.

Available options:
opt_in,
opt_out,
cant_unsubscribe
visible_to_subscriber
boolean

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

mandatory_channels
enum<string>[]

Add mandatory channels that the user can't unsubscribe from if preference is cant_unsubscribe.

Available options:
email,
sms,
whatsapp,
androidpush,
inbox,
iospush,
slack,
webpush,
ms_teams
opt_in_channels
enum<string>[] | null

Add channels that should be opted-in by default when preference is either On or Can't Unsubscribe. Set to null or do not pass this parameter to set all channels as opted-in. In case of Can't Unsubscribe, mandatory channels are opted-in by default.

Available options:
email,
sms,
whatsapp,
androidpush,
inbox,
iospush,
slack,
webpush,
ms_teams
blocked_channels
enum<string>[] | null

Pass channels which are not applicable for the tenant. This setting will apply to all categories and user will not be able to opt-in to these channels for the tenant.

Available options:
email,
sms,
whatsapp,
androidpush,
inbox,
iospush,
slack,
webpush,
ms_teams

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

description of the notification category

root_category
string

root category this sub-category belongs to

Example:

"transactional"

default_preference
enum<string>

default preference of the category set while updating the category.

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

default mandatory channels set while updating the category in case default preference is can't unsubscribe

default_opt_in_channels
string[] | null

default opt-in channels set to have selective opt-in channels instead of all channels while updating the category.

opt_in_channels
string[] | null

opt-in channels overridden for this tenant.

visible_to_subscriber
boolean

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

preference
enum<string>

preference setting overridden for this tenant.

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

channels which are opted-out across all categories for this tenant.

Available options:
email,
sms,
whatsapp,
androidpush,
inbox,
iospush,
slack,
webpush,
ms_teams