v2

latestOpenAPI 3.1.12026-07-2613060964.2 KB

All Categories

API to fetch user preferences across all categories.

get/v1/user/{distinct_id}/preference/category/

Path parameters

distinct_idstring required

distinct_id of the user whose preferences should be fetched

Query parameters

tenant_idstring

to fetch user preferences for a particular tenant

show_opt_out_channelsboolean

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

tagsstring

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}
localestring

Locale code (e.g., es, fr, de, ja, es-AR) to fetch preference translations in user's locale. When provided, the API looks for category and section names and descriptions in the respective locale file. 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).

Response

200

Example response

{
  "meta": {
    "count": 12,
    "limit": 10
  },
  "results": [
    {
      "name": "Newsletter",
      "category": "newsletter",
      "description": "Send me updates on new product updates",
      "preference": "opt_in",
      "channels": [
        {
          "channel": "email",
          "preference": "opt_in"
        }
      ]
    }
  ]
}