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

# Update notification preferences

> Upserts one or more channel preferences for the authenticated user. Accepts a single object or a list of objects. `notification_type: "*"` is a wildcard applied when no type-specific preference exists.



## OpenAPI

````yaml /openapi/shared.yaml put /api/v1/notifications/preferences
openapi: 3.0.3
info:
  title: Shared Service API
  version: 1.0.0
  description: |2-

        **Shared Service API** - Comprehensive shared service and management system.

        ## Versionings
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
  contact:
    name: API Support
    email: thakacreations@gmail.com
  license:
    name: thakacreations
servers: []
security: []
paths:
  /api/v1/notifications/preferences:
    put:
      tags:
        - notifications
      summary: Update notification preferences
      description: >-
        Upserts one or more channel preferences for the authenticated user.
        Accepts a single object or a list of objects. `notification_type: "*"`
        is a wildcard applied when no type-specific preference exists.
      operationId: notifications_preferences_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPreferenceUpdateRequestRequest'
            examples:
              UpdateRequest:
                value:
                  - notification_type: task.assigned
                    channel: email
                    enabled: false
                  - notification_type: '*'
                    channel: sms
                    enabled: true
                summary: Update request
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationPreferenceUpdateRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationPreferenceUpdateRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPreferenceUpdateResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    NotificationPreferenceUpdateRequestRequest:
      type: object
      properties:
        notification_type:
          type: string
          minLength: 1
          default: '*'
        channel:
          enum:
            - websocket
            - email
            - sms
            - push
          type: string
          description: |-
            * `websocket` - websocket
            * `email` - email
            * `sms` - sms
            * `push` - push
          x-spec-enum-id: 6d9732a7dc7cd1ea
        enabled:
          type: boolean
          default: true
      required:
        - channel
    NotificationPreferenceUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/NotificationPreferenceUpdateData'
      required:
        - data
        - message
        - success
    NotificationPreferenceUpdateData:
      type: object
      properties:
        preferences:
          type: array
          items:
            $ref: '#/components/schemas/NotificationPreference'
      required:
        - preferences
    NotificationPreference:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        recipient_id:
          type: string
          format: uuid
        notification_type:
          type: string
          maxLength: 64
        channel:
          enum:
            - websocket
            - email
            - sms
            - push
          type: string
          description: |-
            * `websocket` - WebSocket
            * `email` - Email
            * `sms` - SMS
            * `push` - Push
          x-spec-enum-id: 56bc2c9356ec1bb0
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - channel
        - created_at
        - id
        - notification_type
        - recipient_id
        - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````