update_suprsend_users_preferences
Set a user's category preference to opt-in, opt-out, or locked (cant_unsubscribe) with per-channel opt-outs. Overwrites existing preference for that category.
Instructions
Set ONE category's preference for ONE user — opted in, opted out, or cant_unsubscribe (locked) — plus per-channel opt-outs within that category.
Replaces, does not merge. This call overwrites the existing preference for the named category. Previous opt-outs within the same category are lost; pass them again in opt_out_channels if you want to keep them.
When to use: changing a single category for a single user.
When NOT to use:
For tenant-wide defaults — use update_suprsend_tenant_default_preference.
For cross-category channel toggles ("block all SMS") — use update_suprsend_user_channel_preference.
For the same flow on objects — use update_suprsend_category_preference_object.
Preference values: opt_in enables; opt_out disables; cant_unsubscribe locks the user from toggling this category in their preference UI.
Returns: updated preference state on success; structured error on failure (e.g., unknown category slug).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categories | Yes | The categories to update the preferences for. | |
| channel_preferences | Yes | The channel preferences to update for the users. | |
| distinct_ids | Yes | The distinct_ids of the users to update the preferences for. | |
| workspace | No | SuprSend workspace to run the query from. |