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

# Update notification preferences

> Deep-partial update of notification preferences.

Accepts both the new matrix-aware form (`events`) and the legacy scalar-only
form (`email_enabled`, `slack_enabled`, `digest_frequency`) for backward
compatibility with the current frontend client mapper.

The per-event `events` object accepts any subset of the 9 event keys; unknown
keys are rejected with 400 validation_error.



## OpenAPI

````yaml /openapi.json patch /v1/me/notifications
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/me/notifications:
    patch:
      tags:
        - notifications
      summary: Update notification preferences
      description: >-
        Deep-partial update of notification preferences.


        Accepts both the new matrix-aware form (`events`) and the legacy
        scalar-only

        form (`email_enabled`, `slack_enabled`, `digest_frequency`) for backward

        compatibility with the current frontend client mapper.


        The per-event `events` object accepts any subset of the 9 event keys;
        unknown

        keys are rejected with 400 validation_error.
      operationId: patch_notification_preferences_v1_me_notifications_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPreferencesPatch'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPreferences'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    NotificationPreferencesPatch:
      properties:
        digest_frequency:
          anyOf:
            - enum:
                - realtime
                - daily
                - weekly
                - never
              type: string
            - type: 'null'
          title: Digest Frequency
        email_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Email Enabled
        events:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/ChannelSet'
              type: object
            - type: 'null'
          title: Events
        min_risk_score_for_alert:
          anyOf:
            - maximum: 100
              minimum: 0
              type: integer
            - type: 'null'
          title: Min Risk Score For Alert
        min_severity_for_alert:
          anyOf:
            - enum:
                - p1
                - p2
                - p3
                - p4
              type: string
            - type: 'null'
          title: Min Severity For Alert
        notify_on_new_issue:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On New Issue
        notify_on_pattern_detected:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Pattern Detected
        notify_on_prediction:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Prediction
        notify_on_recommendation:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Recommendation
        notify_on_report_ready:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Report Ready
        pagerduty_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Pagerduty Enabled
        quiet_hours:
          anyOf:
            - $ref: '#/components/schemas/QuietHours'
            - type: 'null'
        slack_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Slack Enabled
        slack_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Webhook Url
        teams_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Teams Enabled
        teams_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Teams Webhook Url
      title: NotificationPreferencesPatch
      type: object
    NotificationPreferences:
      properties:
        digest_frequency:
          default: daily
          enum:
            - realtime
            - daily
            - weekly
            - never
          title: Digest Frequency
          type: string
        email_enabled:
          default: true
          title: Email Enabled
          type: boolean
        events:
          $ref: '#/components/schemas/NotificationEvents'
          default:
            high_confidence_prediction:
              email: true
              in_app: true
              slack: true
            issue_escalated_critical:
              email: true
              in_app: true
              slack: true
            member_invited:
              email: true
              in_app: true
              slack: false
            new_issue_ingested:
              email: true
              in_app: true
              slack: false
            new_prediction:
              email: false
              in_app: true
              slack: false
            pattern_confirmed:
              email: false
              in_app: true
              slack: false
            pattern_detected:
              email: false
              in_app: true
              slack: false
            recommendation_pushed:
              email: false
              in_app: true
              slack: false
            weekly_digest:
              email: true
              in_app: false
              slack: false
        min_risk_score_for_alert:
          default: 70
          maximum: 100
          minimum: 0
          title: Min Risk Score For Alert
          type: integer
        min_severity_for_alert:
          default: p2
          enum:
            - p1
            - p2
            - p3
            - p4
          title: Min Severity For Alert
          type: string
        notify_on_new_issue:
          default: true
          title: Notify On New Issue
          type: boolean
        notify_on_pattern_detected:
          default: true
          title: Notify On Pattern Detected
          type: boolean
        notify_on_prediction:
          default: true
          title: Notify On Prediction
          type: boolean
        notify_on_recommendation:
          default: true
          title: Notify On Recommendation
          type: boolean
        notify_on_report_ready:
          default: true
          title: Notify On Report Ready
          type: boolean
        pagerduty_enabled:
          default: false
          title: Pagerduty Enabled
          type: boolean
        quiet_hours:
          anyOf:
            - $ref: '#/components/schemas/QuietHours'
            - type: 'null'
        slack_enabled:
          default: false
          title: Slack Enabled
          type: boolean
        slack_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Webhook Url
        teams_enabled:
          default: false
          title: Teams Enabled
          type: boolean
        teams_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Teams Webhook Url
        updated_at:
          title: Updated At
          type: string
        user_id:
          title: User Id
          type: string
      required:
        - user_id
        - updated_at
      title: NotificationPreferences
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ChannelSet:
      properties:
        email:
          default: false
          title: Email
          type: boolean
        in_app:
          default: false
          title: In App
          type: boolean
        slack:
          default: false
          title: Slack
          type: boolean
      title: ChannelSet
      type: object
    QuietHours:
      properties:
        end:
          pattern: ^\d{2}:\d{2}$
          title: End
          type: string
        start:
          pattern: ^\d{2}:\d{2}$
          title: Start
          type: string
        timezone:
          title: Timezone
          type: string
      required:
        - start
        - end
        - timezone
      title: QuietHours
      type: object
    NotificationEvents:
      properties:
        high_confidence_prediction:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: true
            in_app: true
            slack: true
        issue_escalated_critical:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: true
            in_app: true
            slack: true
        member_invited:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: true
            in_app: true
            slack: false
        new_issue_ingested:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: true
            in_app: true
            slack: false
        new_prediction:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: false
            in_app: true
            slack: false
        pattern_confirmed:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: false
            in_app: true
            slack: false
        pattern_detected:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: false
            in_app: true
            slack: false
        recommendation_pushed:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: false
            in_app: true
            slack: false
        weekly_digest:
          $ref: '#/components/schemas/ChannelSet'
          default:
            email: true
            in_app: false
            slack: false
      title: NotificationEvents
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````