> ## 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
                    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.

````