---
title: "Update user preference set"
method: PUT
path: "/v1/users/{user_id}/preferences/{id}"
tags: ["Users", "Preferences"]
---

# Update user preference set

`PUT /v1/users/{user_id}/preferences/{id}`

Updates a complete preference set for a user. By default, this is a destructive operation and will replace any existing preferences with the preferences given. Use '__persistence_strategy__': 'merge' to merge with existing preferences instead.

## Path parameters

- `user_id` string, required
- `id` string, required

## Request body

- PreferenceSetRequest — A request to set a preference set for a recipient.
  - `__persistence_strategy__` 'merge' | 'replace' — Controls how the preference set is persisted. 'replace' will completely replace the preference set, 'merge' will merge with existing preferences.
  - `categories` union — An object where the key is the category and the values are the preference settings for that category.
    - object — An object where the key is the category and the values are the preference settings for that category.
    - unknown
  - `channel_types` union — An object where the key is the channel type and the values are the preference settings for that channel type.
    - object — Channel type preferences.
      - `chat` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `email` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `http` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `in_app_feed` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `push` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `sms` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
    - unknown
  - `channels` union — An object where the key is the channel ID and the values are the preference settings for that channel ID.
    - object — Channel preferences.
    - unknown
  - `commercial_subscribed` boolean, nullable — Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.
  - `workflows` union — An object where the key is the workflow key and the values are the preference settings for that workflow.
    - object — An object where the key is the workflow key and the values are the preference settings for that workflow.
    - unknown

## Response `200`

OK

- PreferenceSet — A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets.
  - `categories` union — An object where the key is the category and the values are the preference settings for that category.
    - object — An object where the key is the category and the values are the preference settings for that category.
    - unknown
  - `channel_types` union — An object where the key is the channel type and the values are the preference settings for that channel type.
    - object — Channel type preferences.
      - `chat` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `email` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `http` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `in_app_feed` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `push` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
      - `sms` union — Whether the channel type is enabled for the preference set.
        - boolean
        - object — A set of settings for a channel type. Currently, this can only be a list of conditions to apply.
          - `conditions` Condition[], required — A list of conditions to apply to a channel type.
            - `argument` string, nullable, required — The argument value to compare against in the condition.
            - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'contains' | 'not_contains' | 'empty' | 'not_empty' | 'exists' | 'not_exists' | 'contains_all' | 'is_timestamp' | 'is_not_timestamp' | 'is_timestamp_on_or_after' | 'is_timestamp_before' | 'is_timestamp_on_or_after_date' | 'is_timestamp_before_date' | 'is_timestamp_between' | 'is_between' | 'is_audience_member' | 'is_not_audience_member', required — The operator to use in the condition evaluation.
            - `variable` string, required — The variable to be evaluated in the condition.
    - unknown
  - `channels` union — An object where the key is the channel ID and the values are the preference settings for that channel ID.
    - object — Channel preferences.
    - unknown
  - `commercial_subscribed` boolean, nullable — Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.
  - `id` string, required — Unique identifier for the preference set.
  - `workflows` union — An object where the key is the workflow key and the values are the preference settings for that workflow.
    - object — An object where the key is the workflow key and the values are the preference settings for that workflow.
    - unknown

---

[API](https://skmtc.net/knocklabs/apis/knock-api.md) · [All operations](https://skmtc.net/knocklabs/apis/knock-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/knocklabs/knock-api/versions/4b8499dddbc5/schema)
