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

# Update notification setting

> Update a specific notification setting for a user by setting ID.



## OpenAPI

````yaml PATCH /b2b/notification-settings/{settingId}
openapi: 3.0.3
info:
  title: Wealthyhood Notification Settings API
  version: 1.0.0
  description: >
    B2B API endpoints for managing user notification settings. These endpoints
    allow B2B clients to read and update

    notification preferences for their users.


    All requests require a bearer access token with the advertised scopes, and
    must include the `x-user-id` header

    to identify the user whose notification settings are being accessed or
    modified.


    **Key Features:**

    - Read all notification settings for a user (app and email notifications
    grouped by category)

    - Update individual notification settings by setting ID

    - Device-level notification permissions are handled by B2B clients (not
    exposed via API)


    **Localisation:**

    Category names, notification names, and descriptions are localised based on
    the user's language preference

    (stored in the user profile). The same endpoint returns different text for
    users with different languages.

    Examples in this documentation use English values.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Notification Settings
    description: Manage user notification preferences for app and email notifications.
paths:
  /b2b/notification-settings/{settingId}:
    patch:
      tags:
        - Notification Settings
      summary: Update notification setting
      description: >
        Updates a specific notification setting for the authenticated user. The
        `settingId` path parameter

        identifies which notification setting to update, and the request body
        contains the new `active` status.


        **Available Setting IDs:**

        - **App notifications:** `app_transactional`, `app_learning_guide`,
        `app_analyst_insight`, `app_quick_take`,
          `app_weekly_review`, `app_daily_recap`, `app_promotional`
        - **Email notifications:** `email_transactional`, `email_promotional`,
        `email_wealthybites`


        **Response:** Returns the complete notification settings object (same
        format as GET endpoint) after the update.

        Category names, notification names, and descriptions are localised based
        on the user's language preference.


        **Note:** Device-level notification permissions are not managed through
        this API. B2B clients handle

        device-level permissions independently.
      parameters:
        - $ref: '#/components/parameters/ExternalUserId'
        - $ref: '#/components/parameters/NotificationSettingId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateNotificationSettingRequest'
            examples:
              enableSetting:
                summary: Enable a notification setting
                value:
                  active: true
              disableSetting:
                summary: Disable a notification setting
                value:
                  active: false
      responses:
        '200':
          description: >-
            Notification setting updated successfully. Returns complete
            notification settings object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationSettingsResponse'
              example:
                app:
                  - category: Activity
                    notifications:
                      - id: app_transactional
                        name: Transactional notifications
                        description: Buys, sells, deposits, dividends, etc
                        active: true
                  - category: Market insights
                    notifications:
                      - id: app_learning_guide
                        name: Learning guides
                        description: Updates for new educational guides
                        active: true
                      - id: app_analyst_insight
                        name: Analysis
                        description: Investment ideas, research, insights
                        active: false
                      - id: app_quick_take
                        name: Quick takes
                        description: Bit-sized insights to start your day
                        active: true
                      - id: app_daily_recap
                        name: Morning Update
                        description: Portfolio summary & news digest
                        active: true
                      - id: app_weekly_review
                        name: Weekly reviews
                        description: A weekly summary of market news
                        active: false
                  - category: Offers
                    notifications:
                      - id: app_promotional
                        name: Promos & special offers
                        description: Free shares, rewards & gifts
                        active: false
                email:
                  - category: Activity
                    notifications:
                      - id: email_transactional
                        name: Transactional emails
                        description: Updates on your account & activity
                        active: true
                  - category: Newsletters
                    notifications:
                      - id: email_wealthybites
                        name: Wealthybites
                        description: Weekly summary of your portfolio, news & highlights
                        active: true
                  - category: Offers
                    notifications:
                      - id: email_promotional
                        name: Promos & special offers
                        description: Free shares, rewards & gifts
                        active: false
        '400':
          description: Invalid request - invalid setting ID or request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              examples:
                invalidSettingId:
                  summary: Invalid setting ID provided
                  value:
                    status: 400
                    error:
                      message: Invalid notification setting ID
                      description: Operation failed
                    responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
                invalidBody:
                  summary: Invalid request body
                  value:
                    status: 400
                    error:
                      message: 'Request body validation failed: ''active'' is required'
                    responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
        '401':
          description: >
            Unauthorized. This can occur in two scenarios:

            1. Missing or invalid bearer token (handled globally by
            AuthMiddleware)

            2. User not found - The user specified in the `x-user-id` header
            does not exist or does not have the NBG partnerId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              examples:
                invalidToken:
                  summary: Invalid or missing bearer token
                  value:
                    status: 401
                    error:
                      message: Unauthorized - Invalid or missing authentication token
                    responseId: 145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a
                userNotFound:
                  summary: User not found
                  value:
                    status: 401
                    error:
                      message: invalid_token
                      description: User not found
                    responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
        '500':
          description: >
            Internal server error. This occurs when notification settings
            document is missing (unexpected state).

            Note: Notification settings are created automatically during user
            creation, so a missing document indicates an unexpected state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              examples:
                settingsNotFound:
                  summary: Notification settings not found (unexpected state)
                  value:
                    status: 500
                    error:
                      description: Internal Error
                    responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
components:
  parameters:
    ExternalUserId:
      name: x-user-id
      in: header
      required: true
      description: >-
        MongoDB identifier of the user whose notification settings are being
        accessed or modified.
      schema:
        type: string
        pattern: ^[a-f0-9]{24}$
        example: 507f1f77bcf86cd799439011
    NotificationSettingId:
      name: settingId
      in: path
      required: true
      description: >
        Identifier of the notification setting to update. Must be one of the
        valid notification setting IDs.
      schema:
        type: string
        enum:
          - app_transactional
          - app_learning_guide
          - app_analyst_insight
          - app_quick_take
          - app_weekly_review
          - app_daily_recap
          - app_promotional
          - email_transactional
          - email_promotional
          - email_wealthybites
        example: app_transactional
  schemas:
    UpdateNotificationSettingRequest:
      type: object
      required:
        - active
      properties:
        active:
          type: boolean
          description: New active status for the notification setting
          example: true
      additionalProperties: false
    NotificationSettingsResponse:
      type: object
      description: >
        Complete notification settings for a user, organized by notification
        type (app/email) and category.

        Both `app` and `email` are optional in the schema for flexibility, but
        in practice they will always

        be present since notification settings are created during user creation.

        Category names, notification names, and descriptions are localised based
        on the user's language preference.
      properties:
        app:
          type: array
          description: Array of app notification categories
          items:
            $ref: '#/components/schemas/AppNotificationCategory'
        email:
          type: array
          description: Array of email notification categories
          items:
            $ref: '#/components/schemas/EmailNotificationCategory'
      additionalProperties: false
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message
            description:
              type: string
              description: Additional error details
              nullable: true
        responseId:
          type: string
          format: uuid
          description: Unique identifier for this error response
      additionalProperties: false
    AppNotificationCategory:
      type: object
      required:
        - category
        - notifications
      properties:
        category:
          type: string
          description: >-
            Localised category name for grouping related app notifications
            (e.g., "Activity", "Market insights", "Offers")
          example: Activity
        notifications:
          type: array
          description: Array of app notification settings in this category
          items:
            $ref: '#/components/schemas/AppNotificationSetting'
      additionalProperties: false
    EmailNotificationCategory:
      type: object
      required:
        - category
        - notifications
      properties:
        category:
          type: string
          description: >-
            Localised category name for grouping related email notifications
            (e.g., "Activity", "Newsletters", "Offers")
          example: Activity
        notifications:
          type: array
          description: Array of email notification settings in this category
          items:
            $ref: '#/components/schemas/EmailNotificationSetting'
      additionalProperties: false
    AppNotificationSetting:
      type: object
      required:
        - id
        - name
        - description
        - active
      properties:
        id:
          type: string
          enum:
            - app_transactional
            - app_learning_guide
            - app_analyst_insight
            - app_quick_take
            - app_weekly_review
            - app_daily_recap
            - app_promotional
          description: Unique identifier for the app notification setting
          example: app_transactional
        name:
          type: string
          description: >-
            Localised human-readable name of the notification setting (based on
            user's language preference)
          example: Transactional notifications
        description:
          type: string
          description: >-
            Localised description of what this notification setting controls
            (based on user's language preference)
          example: Buys, sells, deposits, dividends, etc
        active:
          type: boolean
          description: Whether this notification setting is currently enabled
          example: true
      additionalProperties: false
    EmailNotificationSetting:
      type: object
      required:
        - id
        - name
        - description
        - active
      properties:
        id:
          type: string
          enum:
            - email_transactional
            - email_promotional
            - email_wealthybites
          description: Unique identifier for the email notification setting
          example: email_transactional
        name:
          type: string
          description: >-
            Localised human-readable name of the notification setting (based on
            user's language preference)
          example: Transactional emails
        description:
          type: string
          description: >-
            Localised description of what this notification setting controls
            (based on user's language preference)
          example: Updates on your account & activity
        active:
          type: boolean
          description: Whether this notification setting is currently enabled
          example: true
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Auth0-issued access token that includes the scopes listed for the
        endpoint.

````