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

# Overall Channel level

> API to update user preferences across all channels.



## OpenAPI

````yaml PATCH /v1/user/{distinct_id}/preference/channel_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/user/{distinct_id}/preference/channel_preference/:
    patch:
      summary: Overall Channel level
      description: API to update user preferences across all channels.
      operationId: update-user-preference-channel
      parameters:
        - name: distinct_id
          in: path
          description: distinct_id of the user whose preferences should be fetched
          schema:
            type: string
          required: true
        - name: tenant_id
          in: query
          description: to fetch user preferences for a particular tenant
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                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
      responses:
        '202':
          description: '202'
          content:
            application/json:
              examples:
                Result:
                  value:
                    channel_preferences:
                      - channel: email
                        is_restricted: true
                      - channel: inbox
                        is_restricted: false
              schema:
                type: object
                properties:
                  channel_preferences:
                    type: array
                    items:
                      type: object
                      properties:
                        channel:
                          type: string
                          example: email
                        is_restricted:
                          type: boolean
                          example: 'true'
        '400':
          description: 400 - Bad Request
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: 400
                    detail:
                      channel_preferences[0].channel: >-
                        must be one of ["sms", "email", "androidpush" "iospush",
                        "webpush", "inbox", "whatsapp", "slack", "ms_teams"]
                    message: >-
                      {"channel_preferences[0].channel": must be one of ["sms",
                      "email", "androidpush" "iospush", "webpush", "inbox",
                      "whatsapp", "slack", "ms_teams"]
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  detail:
                    type: object
                    description: error details
                  message:
                    type: string
                    description: error message
      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.

````

Built with [Mintlify](https://mintlify.com).