v2

latestOpenAPI 3.1.12026-07-2613060964.2 KB

Update Tenant Preference Single Category

API to update tenant preference for a specific category.

patch/v1/tenant/{tenant_id}/preference/category/{category}/

Path parameters

tenant_idstring required

unique identifier of the tenant you want to update preferences for

categorystring required

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

Request body

preference'opt_in' | 'opt_out' | 'cant_unsubscribe'

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

visible_to_subscriberboolean

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

mandatory_channelsstring[]

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

opt_in_channelsstring[]

List of channels to opt-in for this category. Only applicable when preference is opt_in.

Example request

{
  "digest_schedule": {
    "options": [
      {
        "time": {
          "default_value": "09:00"
        }
      }
    ]
  }
}

Response

200

namestring
categorystring
descriptionstring nullable
tagsstring[] nullable
effective_tagsstring[] nullable
root_category'system' | 'transactional' | 'promotional'

Root category (system, transactional, or promotional) this sub-category belongs to.

default_preference'opt_in' | 'opt_out' | 'cant_unsubscribe'

Category-level default preference, inherited when the tenant has not overridden it.

default_mandatory_channelsstring[] nullable

Category-level mandatory channels (applies when the default preference is cant_unsubscribe).

default_opt_in_channelsstring[] nullable

Category-level opt-in channels, used when only selective channels are opted in by default.

enabled_for_tenantboolean

Whether the category is enabled for this tenant. When false, the category is hidden from the tenant's users and notifications are not sent in it.

visible_to_subscriberboolean

Whether the category appears on the tenant users' preference page.

preference'opt_in' | 'opt_out' | 'cant_unsubscribe' nullable

Tenant's overridden preference for this category. null if the tenant has not overridden the category default.

mandatory_channelsstring[] nullable

Channels the user cannot unsubscribe from (when preference is cant_unsubscribe), as overridden for this tenant.

opt_in_channelsstring[] nullable

Channels opted in by default for this category, as overridden for this tenant.

blocked_channelsstring[] nullable

Channels opted out across all categories for this tenant.

updated_atstring date-time nullable

Timestamp when the tenant preference for this category was last updated.