v2

latestOpenAPI 3.1.12026-07-2613060964.2 KB

Category and Channel within Category

API to update user preferences for a specific notification category.

patch/v1/user/{distinct_id}/preference/category/{category_slug}/

Path parameters

distinct_idstring required

distinct_id of the user whose preferences should be fetched

category_slugstring required

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

Query parameters

tenant_idstring

to fetch user preferences for a particular tenant

localestring

Locale code (e.g., es, fr, de, ja, es-AR) to fetch translated category and section names and descriptions. When provided, the API returns category and section names and descriptions in the specified language if translations are available. If a translation is missing for the requested locale, the system automatically falls back in this order: locale-region (e.g., es-AR) → locale (e.g., es) → en (English - always available).

Request body

preferencestring

choose one of the options: opt_in if the user has allowed notification in this category and opt_out if user wants to discontinue notification in this category

opt_out_channelsstring[]

Add array of channels if user wants to unsubscribe from particular channels in this category. Add channels as email, sms, whatsapp, androidpush, inbox, iospush, slack, webpush

opt_in_channelsstring[]

You can either pass opt_out_channels when user opts out from a channel in the category or opt_in_channels when user opts in to a channel in the category. Add channels as email, sms, whatsapp, androidpush, inbox, iospush, slack, webpush

Response

202

namestring

Display name of the notification category.

categorystring

Slug of the notification category.

descriptionstring

Description of the notification category.

tagsstring[] nullable
effective_tagsstring[] nullable
original_preferencestring

default preference of the category

preferencestring

final user preference of the category

is_editableboolean

false for categories where default preference is set to can't unsubscribe

Example response

{
  "name": "Weekly Activity Digest",
  "category": "weekly-activity-digest",
  "description": "Summary of recent activity in your workspace",
  "original_preference": "opt_in",
  "preference": "opt_in",
  "is_editable": true,
  "channels": [
    {
      "channel": "email",
      "preference": "opt_in",
      "is_editable": true
    }
  ]
}