---
title: "Bulk set preferences"
method: POST
path: "/v1/users/bulk/preferences"
tags: ["Users", "Bulk operations"]
---

# Bulk set preferences

`POST /v1/users/bulk/preferences`

Bulk sets the preferences for up to 1,000 users at a time. The preference set `:id` can be either `default` or a `tenant.id`. Learn more about [per-tenant preferences](/preferences/tenant-preferences). Note that this is a destructive operation and will replace any existing users' preferences with the preferences sent.

## Request body

- BulkSetUserPreferencesRequest — A request to set preferences for a set of users in bulk.
  - `preferences` PreferenceSetRequest, required — 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.
              - …
        - `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.
              - …
        - `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.
              - …
        - `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.
              - …
        - `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.
              - …
        - `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.
              - …
      - 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
  - `user_ids` string[], required — A list of user IDs.

## Response `200`

OK

- BulkOperation — A bulk operation entity.
  - `__typename` string, required — The typename of the schema.
  - `completed_at` string, date-time, nullable — Timestamp when the bulk operation was completed.
  - `error_count` integer — The number of failed operations.
  - `error_items` object[] — A list of items that failed to be processed.
    - `collection` string, nullable — The collection this object belongs to.
    - `id` string, required — Unique identifier for the object.
  - `estimated_total_rows` integer, required — The estimated total number of rows to process.
  - `failed_at` string, date-time, nullable — Timestamp when the bulk operation failed.
  - `id` string, uuid, required — Unique identifier for the bulk operation.
  - `inserted_at` string, date-time, required — Timestamp when the resource was created.
  - `name` string, required — The name of the bulk operation.
  - `processed_rows` integer, required — The number of rows processed so far.
  - `progress_path` string, uri — The URI to the bulk operation's progress.
  - `started_at` string, date-time, nullable — Timestamp when the bulk operation was started.
  - `status` 'queued' | 'processing' | 'completed' | 'failed', required — The status of the bulk operation.
  - `success_count` integer, required — The number of successful operations.
  - `updated_at` string, date-time, required — The timestamp when the resource was last updated.

---

[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)
