> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Update

> Bulk API to update channel and category-level notification preferences for multiple users in one request.



## OpenAPI

````yaml PATCH /v1/bulk/user/preference/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/bulk/user/preference/:
    patch:
      summary: Bulk Update
      description: >-
        Bulk API to update channel and category-level notification preferences
        for multiple users in one request.
      operationId: bulk-update-user-preference
      parameters:
        - name: tenant_id
          in: query
          description: to fetch user preferences for a particular tenant
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - distinct_ids
              properties:
                distinct_ids:
                  type: array
                  description: distinct_id of users whose preference need to be updated
                  default:
                    - id1
                    - id2
                  items:
                    type: string
                channel_preferences:
                  type: array
                  description: >-
                    Use this to update channel level user preferences. Set
                    `is_restricted - true` if the channel is opted_out by the
                    user. This will only send critical notifications to the user
                    which can't be opted out
                  items:
                    properties:
                      channel:
                        type: string
                        description: >-
                          Add channel as `email`, `inbox`, `sms`, `whatsapp`,
                          `androidpush`, `slack`, `iospush`, `webpush`
                        default: email
                      is_restricted:
                        type: boolean
                        description: >-
                          set `is_restricted = true` if user wants to receive
                          notification in mandatory categories on this channel.
                          Mandatory categories are `can't unsubscribe`
                          categories and the above channel is added as
                          `mandatory channel` in that category
                        default: false
                    type: object
                categories:
                  type: array
                  description: >-
                    Use this to user preference across categories and channels
                    inside a category.
                  items:
                    properties:
                      category:
                        type: string
                        description: >-
                          notification category slug. You can get this from
                          Notification Categories page on SuprSend dashboard ->
                          Settings page
                        default: _category_slug_
                      preference:
                        type: string
                        description: >-
                          choose one of the options: `opt_in` if the user has
                          allowed notification in this category and `opt_out` if
                          user wants to discontinue notification in this
                          category
                        default: opt_in
                      opt_out_channels:
                        type: array
                        description: >-
                          Add array of channels if user wants to unsubscribe
                          from particular channels in this category. Add
                          channels as `email`, `sms`, `whatsapp`, `androidpush`,
                          `inbox`, `iospush`, `slack`, `webpush`
                        default: []
                        items:
                          type: string
                      opt_in_channels:
                        type: array
                        description: >-
                          You can either pass opt_out_channels when user opts
                          out from a channel in the category or opt_in_channels
                          when user opts in to a channel in the category. Add
                          channels as `email`, `sms`, `whatsapp`, `androidpush`,
                          `inbox`, `iospush`, `slack`, `webpush`
                        default: []
                        items:
                          type: string
                      digest_schedule:
                        type: object
                        nullable: true
                        description: >
                          Recipient's preferred digest schedule for this
                          category. Set to `null` to fall back to the tenant or
                          category default.
                        properties:
                          id:
                            type: string
                            description: ID of the selected digest schedule option.
                          time:
                            type: string
                            description: >-
                              Override time if the option's `time.edit_policy`
                              is `editable`. Format: HH:MM.
                          dtstart:
                            type: string
                            format: date-time
                            description: >-
                              Override start datetime if the option's
                              `dtstart.edit_policy` is `editable`.
                          weekdays:
                            type: array
                            description: >-
                              Override weekdays if the option's
                              `weekdays.edit_policy` is `editable`.
                            items:
                              type: string
                              enum:
                                - mo
                                - tu
                                - we
                                - th
                                - fr
                                - sa
                                - su
                          monthdays:
                            type: array
                            description: >-
                              Override monthdays if the option's
                              `monthdays.edit_policy` is `editable`.
                            items:
                              type: object
                              properties:
                                pos:
                                  description: >-
                                    Position in the month (1-31; use a negative
                                    value to count from the end).
                                  type: integer
                                day:
                                  description: >-
                                    Optional day of the week (su, mo, tu, we,
                                    th, fr, sa).
                                  type: string
                      properties:
                        type: array
                        description: >-
                          Override values for category condition properties.
                          Only properties with `edit_policy` `editable` can be
                          overridden, and the value's datatype must match the
                          property's `value_type`.
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              description: Property key identifier.
                            value:
                              description: Override value for the property.
                    type: object
      responses:
        '202':
          description: '202'
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: true
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 404
                    message: tenant '_tenant_id_' not found
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: tenant '_tenant_id_' not found
      deprecated: false
      security:
        - BearerAuth: []
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.

````