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

# Update Notification Preferences

> Updates the notification preferences for the current user.

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

### Required Permissions

* `notifications:preferences:update`

**Request Body**
The request body array must contain at least one notification preference object. The object must contain the following properties:

* `notificationType`: The notification type
* `channels`: The notification channels
* `isEnabled`: Whether the notification is enabled

The notificationType can be any of the following:

**Roster Events:**

* `User created` - When a user is created
* `User updated` - When a user is updated
* `User deactivated` - When a user is deactivated
* `User deleted` - When a user is deleted
* `User added to Split` - When a user is added to a split
* `User invitation sent` - When a user invitation is sent
* `User removed from Split` - When a user is removed from a split
* `Artist created` - When an artist is created
* `Artist updated` - When an artist is updated
* `Artist deactivated` - When an artist is deactivated
* `Artist deleted` - When an artist is deleted

**Catalog Events:**

* `Track created` - When an asset/track is created
* `Track updated` - When an asset/track is updated
* `Track deactivated` - When an asset/track is deactivated
* `Track deleted` - When an asset/track is deleted
* `Release created` - When a product/release is created
* `Release updated` - When a product/release is updated
* `Release deactivated` - When a product/release is deactivated
* `Release deleted` - When a product/release is deleted

**Accounting Events:**

* `Payment request sent` - When a payment request is sent
* `Payment request approved` - When a payment request is approved
* `Payment request rejected` - When a payment request is rejected
* `Payment made processing` - When payment is being processed
* `Payment made completed` - When payment is completed
* `Payment made failed` - When payment fails
* `Payment deleted` - When a payment is deleted
* `Payment processing` - When payment processing starts
* `Payment completed` - When payment is completed
* `Expense created` - When an expense is created
* `Expense updated` - When an expense is updated
* `Expense deleted` - When an expense is deleted
* `Revenue created` - When revenue is created
* `Revenue updated` - When revenue is updated
* `Revenue deleted` - When revenue is deleted

**Royalty File Events:**

* `Royalty File uploaded` - When a royalty file is uploaded
* `Royalty File processed` - When a royalty file is processed
* `Royalty File processing failed` - When royalty file processing fails
* `royalty_file_deleted` - When a royalty file is deleted

**Release Management Events:**

* `Release submitted for review` - When a release is submitted
* `Release approved` - When a release is approved
* `Release rejected` - When a release is rejected
* `Release auto-created` - When a release is auto-created
* `Release auto-creation failed` - When release auto-creation fails
* `Release feedback added` - When feedback is added to a release
* `Release updated (management)` - When a release is updated by management
* `Release created (Auto)` - When a release is auto-created
* `Release deleted (Auto)` - When a release is auto-deleted
* `Release error` - When a release error occurs
* `Release status reverted` - When release status is reverted

**File Processing Events:**

* `File processing started` - When file processing starts
* `File processing complete` - When file processing completes
* `File processing failed` - When file processing fails

**DDEX Provider Events:**

* `Provider delivery initiated` - When provider delivery starts
* `Provider delivery completed` - When provider delivery completes
* `Provider delivery failed` - When provider delivery fails
* `Provider delivery acknowledged` - When provider acknowledges delivery
* `Provider status update` - When provider status is updated

**Artist Resolution Events:**

* `Artist auto-created` - When an artist is auto-created
* `Artist resolution failed` - When artist resolution fails

**Merlin Import Events:**

* `Merlin files discovered` - When Merlin files are discovered
* `Merlin download complete` - When Merlin download completes
* `Merlin import approved` - When Merlin import is approved
* `Merlin import completed` - When Merlin import completes
* `Merlin import failed` - When Merlin import fails

**Billing Events:**

* `Billing success` - When billing succeeds
* `Billing error` - When billing error occurs
* `Billing warning` - When billing warning occurs

The channels can be any of the following:

* `email` - Email notifications
* `in_app` - In-app notifications
* `push` - Push notifications
* `webhook` - Webhook notifications

The isEnabled must be a boolean:

* `true` - Enable notifications
* `false` - Disable notifications

**Note:** Channel values are case-sensitive and must be lowercase.

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/notifications/preferences', {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "preferences": [
        {
          "notificationType": "Artist created",
          "channels": [
            "email",
            "in_app",
            "push"
          ],
          "isEnabled": true
        },
        {
          "notificationType": "Artist deleted",
          "channels": [
            "email",
            "in_app",
            "push"
          ],
          "isEnabled": true
        }
      ]
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
    'https://api.royalti.io/notifications/preferences',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"preferences":[{"notificationType":"Artist created","channels":["email","in_app","push"],"isEnabled":true},{"notificationType":"Artist deleted","channels":["email","in_app","push"],"isEnabled":true}]}
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X PUT https://api.royalti.io/notifications/preferences \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"preferences":[{"notificationType":"Artist created","channels":["email","in_app","push"],"isEnabled":true},{"notificationType":"Artist deleted","channels":["email","in_app","push"],"isEnabled":true}]}'

  ```
</CodeGroup>


## OpenAPI

````yaml put /notifications/preferences
openapi: 3.0.0
info:
  title: Royalti.io API
  description: "# Royalti API\r\n\r\nThis is the Royalti music royalty management platform API server.\r\n\r\n## Overview\r\n\r\nThe Royalti API provides comprehensive music royalty management services including:\r\n- Music publishing and writer management\r\n- Royalty processing and analytics\r\n- DDEX integration for music industry standards\r\n- File processing and pattern recognition\r\n- Payment processing and distribution\r\n\r\n## Authentication\r\n\r\nThe API uses JWT-based authentication with multiple protection levels:\r\n- Public endpoints for basic operations\r\n- Protected endpoints requiring valid JWT tokens\r\n- Admin endpoints for administrative functions\r\n\r\n## Features\r\n\r\n- Multi-dimensional royalty analytics\r\n- CWR (Collective Works Registration) support\r\n- DDEX integration for music metadata\r\n- Advanced file processing with pattern recognition\r\n- Real-time data processing with queue system"
  version: 2.6.0
  contact:
    name: Royalti.io Support
    email: support@royalti.io
    url: https://royalti.io
  license:
    name: Proprietary
    url: https://royalti.io/terms
servers:
  - url: https://api.royalti.io
    description: Production server
  - url: https://api-dev.royalti.io
    description: Development server
  - url: http://localhost:8084
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounting
    description: Accounting and financial transaction operations
  - name: DDEX
    description: DDEX operations (ERN/MEAD, messages, delivery, providers)
  - name: Label
    description: Label management operations
  - name: Internal Webhooks
    description: Internal system webhooks for royalty processing and downloads
  - name: Payment Webhooks
    description: Payment processor webhook endpoints
  - name: Billing Webhooks
    description: Stripe billing and subscription webhooks
  - name: Infrastructure Webhooks
    description: Cloudflare domain and SSL webhooks
  - name: Distribution Webhooks
    description: Digital distribution platform webhooks (FUGA)
paths:
  /notifications/preferences:
    put:
      tags:
        - Notifications
      summary: Update Notification Preferences
      description: >-
        Updates the notification preferences for the current user.


        ### Required Permissions

        - `notifications:preferences:update`


        **Request Body**

        The request body array must contain at least one notification preference
        object. The object must contain the following properties:

        - `notificationType`: The notification type

        - `channels`: The notification channels

        - `isEnabled`: Whether the notification is enabled


        The notificationType can be any of the following:


        **Roster Events:**

        - `User created` - When a user is created

        - `User updated` - When a user is updated

        - `User deactivated` - When a user is deactivated

        - `User deleted` - When a user is deleted

        - `User added to Split` - When a user is added to a split

        - `User invitation sent` - When a user invitation is sent

        - `User removed from Split` - When a user is removed from a split

        - `Artist created` - When an artist is created

        - `Artist updated` - When an artist is updated

        - `Artist deactivated` - When an artist is deactivated

        - `Artist deleted` - When an artist is deleted


        **Catalog Events:**

        - `Track created` - When an asset/track is created

        - `Track updated` - When an asset/track is updated

        - `Track deactivated` - When an asset/track is deactivated

        - `Track deleted` - When an asset/track is deleted

        - `Release created` - When a product/release is created

        - `Release updated` - When a product/release is updated

        - `Release deactivated` - When a product/release is deactivated

        - `Release deleted` - When a product/release is deleted


        **Accounting Events:**

        - `Payment request sent` - When a payment request is sent

        - `Payment request approved` - When a payment request is approved

        - `Payment request rejected` - When a payment request is rejected

        - `Payment made processing` - When payment is being processed

        - `Payment made completed` - When payment is completed

        - `Payment made failed` - When payment fails

        - `Payment deleted` - When a payment is deleted

        - `Payment processing` - When payment processing starts

        - `Payment completed` - When payment is completed

        - `Expense created` - When an expense is created

        - `Expense updated` - When an expense is updated

        - `Expense deleted` - When an expense is deleted

        - `Revenue created` - When revenue is created

        - `Revenue updated` - When revenue is updated

        - `Revenue deleted` - When revenue is deleted


        **Royalty File Events:**

        - `Royalty File uploaded` - When a royalty file is uploaded

        - `Royalty File processed` - When a royalty file is processed

        - `Royalty File processing failed` - When royalty file processing fails

        - `royalty_file_deleted` - When a royalty file is deleted


        **Release Management Events:**

        - `Release submitted for review` - When a release is submitted

        - `Release approved` - When a release is approved

        - `Release rejected` - When a release is rejected

        - `Release auto-created` - When a release is auto-created

        - `Release auto-creation failed` - When release auto-creation fails

        - `Release feedback added` - When feedback is added to a release

        - `Release updated (management)` - When a release is updated by
        management

        - `Release created (Auto)` - When a release is auto-created

        - `Release deleted (Auto)` - When a release is auto-deleted

        - `Release error` - When a release error occurs

        - `Release status reverted` - When release status is reverted


        **File Processing Events:**

        - `File processing started` - When file processing starts

        - `File processing complete` - When file processing completes

        - `File processing failed` - When file processing fails


        **DDEX Provider Events:**

        - `Provider delivery initiated` - When provider delivery starts

        - `Provider delivery completed` - When provider delivery completes

        - `Provider delivery failed` - When provider delivery fails

        - `Provider delivery acknowledged` - When provider acknowledges delivery

        - `Provider status update` - When provider status is updated


        **Artist Resolution Events:**

        - `Artist auto-created` - When an artist is auto-created

        - `Artist resolution failed` - When artist resolution fails


        **Merlin Import Events:**

        - `Merlin files discovered` - When Merlin files are discovered

        - `Merlin download complete` - When Merlin download completes

        - `Merlin import approved` - When Merlin import is approved

        - `Merlin import completed` - When Merlin import completes

        - `Merlin import failed` - When Merlin import fails


        **Billing Events:**

        - `Billing success` - When billing succeeds

        - `Billing error` - When billing error occurs

        - `Billing warning` - When billing warning occurs


        The channels can be any of the following:

        - `email` - Email notifications

        - `in_app` - In-app notifications

        - `push` - Push notifications

        - `webhook` - Webhook notifications


        The isEnabled must be a boolean:

        - `true` - Enable notifications

        - `false` - Disable notifications


        **Note:** Channel values are case-sensitive and must be lowercase.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                preferences:
                  type: array
                  items:
                    $ref: '#/components/schemas/NotificationPreference'
                  minItems: 1
                  example:
                    - notificationType: Artist created
                      channels:
                        - email
                        - in_app
                        - push
                      isEnabled: true
                    - notificationType: Artist deleted
                      channels:
                        - email
                        - in_app
                        - push
                      isEnabled: true
              required:
                - preferences
      responses:
        '200':
          description: Notification preferences updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPreferencesResponse'
              example:
                status: success
                message: Notification preferences updated successfully
                data:
                  preferences:
                    - id: 65fdcd80-cada-4c76-83ec-70d8e895774d
                      notificationType: User invitation sent
                      channels:
                        - email
                        - in_app
                      isEnabled: true
                      TenantId: 2
                      TenantUserId: c75c54e3-b6e0-4b89-b443-928727b9a931
                      createdAt: '2025-05-27T19:55:02.423Z'
                      updatedAt: '2025-05-27T19:55:02.423Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    NotificationPreference:
      type: object
      required:
        - notificationType
        - channels
        - isEnabled
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for the notification preference (auto-generated)
          example: 65fdcd80-cada-4c76-83ec-70d8e895774d
        notificationType:
          type: string
          description: >-
            Type of notification (human-readable string values - see endpoint
            description for full list)
          example: User invitation sent
        channels:
          type: array
          items:
            type: string
            enum:
              - in_app
              - email
              - push
              - webhook
          description: Delivery channels for the notification
          default:
            - in_app
          minItems: 1
          example:
            - email
            - in_app
        isEnabled:
          type: boolean
          description: Whether the notification preference is enabled
          default: true
          example: true
        TenantId:
          type: integer
          readOnly: true
          description: Tenant ID (auto-assigned)
          example: 2
        TenantUserId:
          type: string
          format: uuid
          readOnly: true
          description: User ID (auto-assigned)
          example: 65fdcd80-cada-4c76-83ec-70d8e895774d
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp
          example: '2025-07-10T14:30:00Z'
        updatedAt:
          type: string
          format: date-time
          readOnly: true
          description: Last update timestamp
          example: '2025-07-10T14:30:00Z'
    NotificationPreferencesResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: Notification preferences retrieved successfully
        data:
          type: array
          items:
            $ref: '#/components/schemas/NotificationPreference'
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              message:
                type: string
                example: Invalid request parameters
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              message:
                type: string
                example: Unauthorized
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              message:
                type: string
                example: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````