Skip to main content
PATCH
/
v1
/
user
/
{distinct_id}
/
preference
Update User Full Preference
curl --request PATCH \
  --url https://hub.suprsend.com/v1/user/{distinct_id}/preference/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "distinct_ids": [
    "id1",
    "id2"
  ],
  "channel_preferences": [
    {
      "channel": "email",
      "is_restricted": false
    }
  ],
  "categories": [
    {
      "category": "_category_slug_",
      "preference": "opt_in",
      "opt_out_channels": [],
      "opt_in_channels": []
    }
  ]
}
'
{
  "sections": [
    {
      "name": null,
      "slug": null,
      "subcategories": [
        {
          "name": "Promotion de remboursement",
          "category": "refund-promotion",
          "description": "mises à jour",
          "original_preference": null,
          "preference": "opt_in",
          "is_editable": false,
          "channels": [
            {
              "channel": "email",
              "preference": "opt_in",
              "is_editable": false
            },
            {
              "channel": "inbox",
              "preference": "opt_in",
              "is_editable": false
            }
          ]
        }
      ]
    }
  ],
  "channel_preferences": [
    {
      "channel": "email",
      "is_restricted": false
    },
    {
      "channel": "inbox",
      "is_restricted": false
    }
  ]
}

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 updated

Query Parameters

tenant_id
string

to update user preferences for a particular tenant

Body

application/json
distinct_ids
string[]

distinct_id of users whose preference need to be updated

channel_preferences
object[]

Use this to update channel level user preferences. Set is_restricted - true if the channel is opted_out by the user. This will only send critical notifications to the user which can't be opted out

categories
object[]

Use this to update user preference across categories and channels inside a category.

Response

200

sections
object[]
channel_preferences
object[]