GET
/
v1
/
user
/
{distinct_id}
/
preference
curl --request GET \
  --url https://hub.suprsend.com/v1/user/{distinct_id}/preference/ \
  --header 'Authorization: Bearer <token>'
{
  "sections": [
    {
      "subcategories": [
        {
          "name": "Newsletter",
          "category": "newsletter",
          "description": "Send me updates on new product updates",
          "preference": "opt_in",
          "is_editable": true,
          "channels": [
            {
              "channel": "androidpush",
              "preference": "opt_in",
              "is_editable": true
            },
            {
              "channel": "email",
              "preference": "opt_in",
              "is_editable": true
            }
          ]
        }
      ]
    }
  ],
  "channel_preferences": [
    {
      "channel": "email",
      "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 fetched

Query Parameters

tenant_id
string

to fetch user preferences for a particular tenant

show_opt_out_channels
boolean
default:true

set this flag to true if you want to fetch channel list for opt-out categories.

tags
string

Filter preference categories with tags assigned to them. Used to filter preference categories relevant to the user on UI based on their roles, department or teams. You can apply single tag filter like tags=tag1 or build nested conditions using logical operators - and, or, not, exists.

Example:

tags=admin
tags={"or":[{"and":["admin","sales"]},{"and":["admin","manager"]}]}
tags={"not":"admin"}
tags={"exists":true}

Response

200
application/json

200

sections
object[]
channel_preferences
object[]