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

> Update preferences, templates and sounds for the given app.

# Update Settings

For the complete error reference, see [Error Guide](/rest-api/notifications-apis/error-codes).


## OpenAPI

````yaml patch /notifications/v1/settings
openapi: 3.0.0
info:
  title: Chat APIs
  description: Manage messages, users, groups for a particular app using our Chat API.
  version: '3.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: API Keys
    description: The API keys are used to authorise the APIs
  - name: Roles
    description: The roles are used to give user access rights
  - name: Users
    description: The REST collection for users.
  - name: Auth Tokens
    description: The auth tokens are used to login end users using client SDKs.
  - name: Blocked Users
    description: The REST collections for blocked users.
  - name: Friends
    description: List,add and remove friends by passing UID in path variables
  - name: Groups
    description: The REST collections for groups.
  - name: Banned Users
    description: Ban and Unban user by passing other UID in path variables.
  - name: Group Members
    description: The REST collections for group members.
  - name: Messages
    description: The REST collections for messages.
  - name: Conversations
    description: The REST collections for conversations.
  - name: Restrict Features
    description: Allows Restricting Features
  - name: Metrics
    description: Allows accessing Data Metrics
  - name: Triggers
    description: Allows adding triggers to a webhook.
  - name: Webhooks
    description: Allows accessing Webhooks.
  - name: Notifications
    description: Allows configuring Notifications core.
paths:
  /notifications/v1/settings:
    patch:
      tags:
        - Notifications
      summary: Update Settings
      description: Update preferences, templates and sounds for the given app.
      operationId: notifications-push-update-settings
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pnSettingSchema'
      responses:
        '200':
          description: A list of push notification's settings
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items: {}
                type: object
              example:
                data:
                  success: true
      security:
        - apiKey: []
components:
  schemas:
    pnSettingSchema:
      description: Response data
      properties:
        preferences:
          $ref: '#/components/schemas/Preferences'
        sound:
          $ref: '#/components/schemas/Sound'
        templates:
          $ref: '#/components/schemas/Templates'
      type: object
    Preferences:
      properties:
        push:
          properties:
            includeMessageObjectSetting:
              description: Include the message object in the push payload
              type: boolean
            includeSenderMetadataSetting:
              description: Include the sender's metadata as part of the message object
              type: boolean
            includeReceiverMetadataSetting:
              description: Include the receiver's metadata as part of the message object
              type: boolean
            trimTextFieldSetting:
              description: Trim the text field if present.
              type: boolean
            includeMessageMetadataSetting:
              description: Include the message's metadata as part of the message object
              type: boolean
            customJson:
              description: A custom JSON object for miscellaneous data
              type: object
          type: object
        call:
          properties:
            initiatedSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            ongoingSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            cancelledSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            busySetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            rejectedSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            unansweredSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
            endedSetting:
              description: |-
                1: Don't notify
                2: Notify
              type: integer
              enum:
                - 1
                - 2
              example: 2
          type: object
        bypassPreferencesForMentions:
          type: boolean
        group:
          $ref: '#/components/schemas/Group'
        oneOnOne:
          $ref: '#/components/schemas/oneOnOne'
        mute:
          $ref: '#/components/schemas/Mute'
        email:
          $ref: '#/components/schemas/email'
        sms:
          $ref: '#/components/schemas/sms'
      type: object
    Sound:
      properties:
        chat:
          type: string
        call:
          type: string
      type: object
    Templates:
      properties:
        usePrivacyTemplate:
          description: |-
            1: Use default templates
            2: Use privacy templates
            3: Use default templates with end-user privacy override
          type: integer
          enum:
            - 1
            - 2
            - 3
        textMessageTemplateDefault:
          $ref: '#/components/schemas/Template'
        textMessageTemplatePrivacy:
          $ref: '#/components/schemas/Template'
        mediaMessageTemplateDefault:
          $ref: '#/components/schemas/MediaMessageTemplate'
        mediaMessageTemplatePrivacy:
          $ref: '#/components/schemas/MediaMessageTemplate'
        pollMessageTemplateDefault:
          description: >-
            Default template for poll messages (category: custom, type:
            extension_poll).
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        pollMessageTemplatePrivacy:
          description: >-
            Privacy template for poll messages (category: custom, type:
            extension_poll).
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        reminderMessageTemplateDefault:
          description: >-
            Default template for reminder messages (category: custom, type:
            extension_reminders).
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        reminderMessageTemplatePrivacy:
          description: >-
            Privacy template for reminder messages (category: custom, type:
            extension_reminders).
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        customMessageTemplateDefault:
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        customMessageTemplatePrivacy:
          allOf:
            - properties:
                body_fallback:
                  type: string
              type: object
            - $ref: '#/components/schemas/Template'
        emailSubjectTemplateDefault:
          properties:
            subjectGroup:
              type: string
              example: While you were away...
            subjectOneOnOne:
              type: string
              example: While you were away...
          type: object
        emailSubjectTemplatePrivacy:
          properties:
            subjectGroup:
              type: string
              example: While you were away...
            subjectOneOnOne:
              type: string
              example: While you were away...
          type: object
        smsContentTemplateDefault:
          properties:
            bodyGroup:
              type: string
              example: >-
                You've received new messages in {{groupDetails.name}}! You can
                read the message at https://your-website.com.
            bodyOneOnOne:
              type: string
              example: >-
                You've received new messages from {{sender.name}}! You can read
                the message at https://your-website.com.
          type: object
        smsContentTemplatePrivacy:
          properties:
            bodyGroup:
              type: string
              example: >-
                You've received new messages in {{groupDetails.name}}! You can
                read the message at https://your-website.com.
            bodyOneOnOne:
              type: string
              example: >-
                You've received new messages from {{sender.name}}! You can read
                the message at https://your-website.com.
          type: object
        userMentionTemplatePrivacy:
          $ref: '#/components/schemas/UserMentionTemplate'
        groupMentionTemplatePrivacy:
          $ref: '#/components/schemas/GroupMentionTemplate'
        groupMentionTemplateDefault:
          $ref: '#/components/schemas/GroupMentionTemplate'
        userMentionTemplateDefault:
          $ref: '#/components/schemas/UserMentionTemplate'
      type: object
    Group:
      properties:
        messagesSetting:
          description: |-
            1: Don't notify
            2: Notify for all messages
            3: Notify for messages with mentions
          type: integer
          enum:
            - 1
            - 2
            - 3
        messagesOverride:
          type: boolean
        repliesSetting:
          description: |-
            1: Don't notify
            2: Notify for all replies
            3: Notify for replies with mentions
          type: integer
          enum:
            - 1
            - 2
            - 3
        repliesOverride:
          type: boolean
        reactionsSetting:
          description: |-
            1: Don't notify
            2: Notify for reactions received on own messages
            3: Notify for reactions received on all messages
          type: integer
          enum:
            - 1
            - 2
            - 3
        reactionsOverride:
          type: boolean
        memberLeftSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberLeftOverride:
          type: boolean
        memberAddedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberAddedOverride:
          type: boolean
        memberJoinedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberJoinedOverride:
          type: boolean
        memberKickedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberKickedOverride:
          type: boolean
        memberBannedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberBannedOverride:
          type: boolean
        memberUnbannedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberUnbannedOverride:
          type: boolean
        memberScopeChangedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        memberScopeChangedOverride:
          type: boolean
        messageEditedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        messageDeletedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
      type: object
    oneOnOne:
      properties:
        messagesSetting:
          description: |-
            1: Don't notify
            2: Notify for all messages
            3: Notify for messages with mentions
          type: integer
          enum:
            - 1
            - 2
            - 3
        messagesOverride:
          type: boolean
        repliesSetting:
          description: |-
            1: Don't notify
            2: Notify for all replies
            3: Notify for replies with mentions
          type: integer
          enum:
            - 1
            - 2
            - 3
        repliesOverride:
          type: boolean
        reactionsSetting:
          description: |-
            1: Don't notify
            2: Notify for reactions received on own messages
            3: Notify for reactions received on all messages
          type: integer
          enum:
            - 1
            - 2
            - 3
        reactionsOverride:
          type: boolean
        messageEditedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
        messageDeletedSetting:
          description: |-
            1: Don't notify
            2: Notify
          type: integer
          enum:
            - 1
            - 2
      type: object
    Mute:
      properties:
        dndPreferenceOverride:
          type: boolean
        mutedGroupsOverride:
          type: boolean
        mutedOneOnOnesOverride:
          type: boolean
        schedulePreferenceSetting:
          properties:
            monday:
              $ref: '#/components/schemas/Day'
            tuesday:
              $ref: '#/components/schemas/Day'
            wednesday:
              $ref: '#/components/schemas/Day'
            thursday:
              $ref: '#/components/schemas/Day'
            friday:
              $ref: '#/components/schemas/Day'
            saturday:
              $ref: '#/components/schemas/Day'
            sunday:
              $ref: '#/components/schemas/Day'
          type: object
        schedulePreferenceOverride:
          type: boolean
      type: object
    email:
      properties:
        notifyForUnreadOnly:
          description: >-
            If the value is false, the notification will contain all the
            messages, not just unread.
          type: boolean
        intervalInSeconds:
          type: integer
        maxPerDay:
          type: integer
        maxPerDayPerConversation:
          type: integer
      type: object
    sms:
      properties:
        notifyForUnreadOnly:
          description: >-
            If the value is false, the notification will contain all the
            messages, not just unread.
          type: boolean
        intervalInSeconds:
          type: integer
        maxPerDay:
          type: integer
        maxPerDayPerConversation:
          type: integer
      type: object
    Template:
      properties:
        titleOneOnOne:
          type: string
          example: '{{message.data.entities.sender.entity.name}}'
        titleGroup:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} @
            {{message.data.entities.receiver.entity.name}}
        body:
          type: string
          example: New text message
      type: object
    MediaMessageTemplate:
      properties:
        titleOneOnOne:
          type: string
          example: '{{message.data.entities.sender.entity.name}}'
        titleGroup:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} @
            {{message.data.entities.receiver.entity.name}}
        body_image:
          type: string
          example: Has sent an {{message.type}}
        body_audio:
          type: string
          example: Has sent an {{message.type}}
        body_video:
          type: string
          example: Has sent a {{message.type}}
        body_file:
          type: string
          example: Has sent a {{message.type}}
      type: object
    UserMentionTemplate:
      description: >-
        Push notification template for user @mentions. User mentions can occur
        in both one-on-one and group conversations.
      properties:
        titleOneOnOne:
          type: string
          example: '{{message.data.entities.sender.entity.name}}'
        titleGroup:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} @
            {{message.data.entities.receiver.entity.name}}
        bodyOneOnOne:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} mentioned you:
            {{message.data.text}}
        bodyGroup:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} mentioned you in
            {{message.data.entities.receiver.entity.name}}:
            {{message.data.text}}
        body_fallback:
          type: string
          example: New mention
      type: object
    GroupMentionTemplate:
      description: Push notification template for @all mentions.
      properties:
        titleGroup:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} @
            {{message.data.entities.receiver.entity.name}}
        body:
          type: string
          example: >-
            {{message.data.entities.sender.entity.name}} mentioned everyone:
            {{message.data.text}}
        body_fallback:
          type: string
          example: New mention
      type: object
    Day:
      properties:
        from:
          type: integer
          format: int32
          maximum: 2359
          minimum: 0
        to:
          type: integer
          format: int32
          maximum: 2359
          minimum: 0
        dnd:
          type: boolean
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````