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

# Upsert workspace rule

> Create or replace the notification rule for one workspace, overriding the global settings there.



## OpenAPI

````yaml /openapi.json put /notification-preferences/workspaces/{workspaceId}
openapi: 3.1.0
info:
  title: Kaneo API
  version: 1.0.0
  description: Kaneo Project Management API - Manage projects, tasks, labels, and more
servers:
  - url: https://cloud.kaneo.app/api
    description: Kaneo API Server
security:
  - bearerAuth: []
paths:
  /notification-preferences/workspaces/{workspaceId}:
    put:
      tags:
        - Notification Preferences
      summary: Upsert workspace rule
      description: >-
        Create or replace the notification rule for one workspace, overriding
        the global settings there.
      operationId: upsertNotificationPreferenceWorkspaceRule
      parameters:
        - schema:
            type: string
          required: true
          name: workspaceId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isActive:
                  type: boolean
                emailEnabled:
                  type: boolean
                ntfyEnabled:
                  type: boolean
                gotifyEnabled:
                  type: boolean
                webhookEnabled:
                  type: boolean
                projectMode:
                  type: string
                  enum:
                    - all
                    - selected
                selectedProjectIds:
                  type: array
                  items:
                    type: string
                  description: Required in practice when projectMode is `selected`.
              required:
                - isActive
                - emailEnabled
                - ntfyEnabled
                - gotifyEnabled
                - webhookEnabled
                - projectMode
      responses:
        '200':
          description: The updated preferences
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPreferences'
        '400':
          description: Invalid request
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Missing or invalid credentials
        '403':
          description: No access to the workspace
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    NotificationPreferences:
      type: object
      properties:
        emailAddress:
          type:
            - string
            - 'null'
        emailEnabled:
          type: boolean
        ntfyEnabled:
          type: boolean
        ntfyConfigured:
          type: boolean
        ntfyServerUrl:
          type:
            - string
            - 'null'
        ntfyTopic:
          type:
            - string
            - 'null'
        ntfyTokenConfigured:
          type: boolean
        maskedNtfyToken:
          type:
            - string
            - 'null'
        gotifyEnabled:
          type: boolean
        gotifyConfigured:
          type: boolean
        gotifyServerUrl:
          type:
            - string
            - 'null'
        gotifyTokenConfigured:
          type: boolean
        maskedGotifyToken:
          type:
            - string
            - 'null'
        webhookEnabled:
          type: boolean
        webhookConfigured:
          type: boolean
        webhookUrl:
          type:
            - string
            - 'null'
        webhookSecretConfigured:
          type: boolean
        maskedWebhookSecret:
          type:
            - string
            - 'null'
        taskAssignmentEnabled:
          type: boolean
        taskCommentEnabled:
          type: boolean
        taskStatusChangeEnabled:
          type: boolean
        dueDateReminderEnabled:
          type: boolean
        dueDateReminderLeadTimeMinutes:
          type: number
          description: How long before a due date the reminder fires, in minutes.
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/NotificationPreferenceWorkspaceRule'
          description: >-
            Per-workspace overrides. A workspace with no rule follows the global
            settings.
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - emailAddress
        - emailEnabled
        - ntfyEnabled
        - ntfyConfigured
        - ntfyServerUrl
        - ntfyTopic
        - ntfyTokenConfigured
        - maskedNtfyToken
        - gotifyEnabled
        - gotifyConfigured
        - gotifyServerUrl
        - gotifyTokenConfigured
        - maskedGotifyToken
        - webhookEnabled
        - webhookConfigured
        - webhookUrl
        - webhookSecretConfigured
        - maskedWebhookSecret
        - taskAssignmentEnabled
        - taskCommentEnabled
        - taskStatusChangeEnabled
        - dueDateReminderEnabled
        - dueDateReminderLeadTimeMinutes
        - workspaces
        - createdAt
        - updatedAt
    NotificationPreferenceWorkspaceRule:
      type: object
      properties:
        id:
          type: string
        workspaceId:
          type: string
        workspaceName:
          type: string
        isActive:
          type: boolean
          description: Turn all notifications for this workspace on or off.
        emailEnabled:
          type: boolean
        ntfyEnabled:
          type: boolean
        gotifyEnabled:
          type: boolean
        webhookEnabled:
          type: boolean
        projectMode:
          type: string
          enum:
            - all
            - selected
          description: >-
            `all` notifies for every project in the workspace; `selected`
            restricts it to selectedProjectIds.
        selectedProjectIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - workspaceId
        - workspaceName
        - isActive
        - emailEnabled
        - ntfyEnabled
        - gotifyEnabled
        - webhookEnabled
        - projectMode
        - selectedProjectIds
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or session token (Bearer)

````