Skip to main content
PATCH
/
v1
/
user
/
{distinct_id}
/
preference
/
category
/
{category_slug}
/
Update User Category Preference - Opt Out Channel
curl -X PATCH "https://hub.suprsend.com/v1/user/user123/preference/status-update-alert/" \
  --header 'Authorization: Bearer __YOUR_API_KEY__' \
  --header 'Content-Type: application/json' \
  --data '{
    "preference": "opt_in",
    "opt_out_channels": ["email", "slack"]
  }'
{
  "name": "Status Update Alert",
  "category": "status-update-alert",
  "description": "Send me updates when account status changes",
  "original_preference": "opt_in",
  "preference": "opt_in",
  "is_editable": true,
  "channels": [
    {
      "channel": "email",
      "preference": "opt_in",
      "is_editable": true
    },
    {
      "channel": "ms_teams",
      "preference": "opt_in",
      "is_editable": true
    },
    {
      "channel": "slack",
      "preference": "opt_in",
      "is_editable": true
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

distinct_id
string
required

distinct_id of the user whose preferences should be fetched

category_slug
string
required

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

Query Parameters

tenant_id
string

to fetch user preferences for a particular tenant

Body

application/json
preference
string
default:opt_in

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_channels
string[]

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

Response

202

name
string
Example:

"Status Update Alert"

category
string
Example:

"status-update-alert"

description
string
Example:

"Send me updates when account status changes"

original_preference
string

default preference of the category

Example:

"opt_in"

preference
string

final user preference of the category

Example:

"opt_in"

is_editable
boolean

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

Example:

true

channels
object[]
I