> ## 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.

# Create Default Setting (Tenant/Catalog Level)

> **POST /defaultsettings/{entityType}**

## Description

**POST /defaultsettings/{entityType}**

**Description:**
Create a new default setting for tenant or catalog level. Each entity can have one setting per category.

**Entity Types (for this endpoint):**

* `tenant` - Workspace-wide defaults
* `catalog` - Catalog-level defaults

**Note:** For label, artist, or user-specific defaults, use the `POST /defaultsettings/{entityType}/{entityId}` endpoint instead.

**Validation:**

* Only one setting per entity + category combination
* Settings are automatically validated against the category schema

**Method:**
`POST`

**Path Parameters:**

| Parameter  | Type   | Description                        | Required |
| ---------- | ------ | ---------------------------------- | -------- |
| entityType | string | Type of entity (tenant or catalog) | Yes      |

**Request Body:**

| Parameter | Type    | Description                                             | Required |
| --------- | ------- | ------------------------------------------------------- | -------- |
| category  | string  | Settings category (content, business, ddex, validation) | Yes      |
| settings  | object  | Settings data matching the category schema              | Yes      |
| priority  | integer | Priority for conflict resolution (default: 0)           | No       |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/defaultsettings/example-id', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "category": "sample-category",
      "priority": 1
    })
  });

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

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

  response = requests.post(
    'https://api.royalti.io/defaultsettings/example-id',
    json={"category":"sample-category","priority":1}
  )

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

  ```bash cURL theme={null}
  curl -X POST https://api.royalti.io/defaultsettings/example-id \
    -H "Content-Type: application/json" \
    -d '{"category":"sample-category","priority":1}'

  ```
</CodeGroup>


## OpenAPI

````yaml post /defaultsettings/{entityType}
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:
  /defaultsettings/{entityType}:
    post:
      tags:
        - Default Settings
      summary: Create Default Setting (Tenant/Catalog Level)
      description: >-
        **POST /defaultsettings/{entityType}**


        **Description:**

        Create a new default setting for tenant or catalog level. Each entity
        can have one setting per category.


        **Entity Types (for this endpoint):**

        - `tenant` - Workspace-wide defaults

        - `catalog` - Catalog-level defaults


        **Note:** For label, artist, or user-specific defaults, use the `POST
        /defaultsettings/{entityType}/{entityId}` endpoint instead.


        **Validation:**

        - Only one setting per entity + category combination

        - Settings are automatically validated against the category schema


        **Method:**

        `POST`


        **Path Parameters:**


        | Parameter | Type | Description | Required |

        | --- | --- | --- | --- |

        | entityType | string | Type of entity (tenant or catalog) | Yes |


        **Request Body:**


        | Parameter | Type | Description | Required |

        | --- | --- | --- | --- |

        | category | string | Settings category (content, business, ddex,
        validation) | Yes |

        | settings | object | Settings data matching the category schema | Yes |

        | priority | integer | Priority for conflict resolution (default: 0) |
        No |
      parameters:
        - name: entityType
          in: path
          required: true
          schema:
            type: string
            enum:
              - tenant
              - catalog
          description: Type of entity (tenant or catalog only)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - category
                - settings
              properties:
                category:
                  type: string
                  enum:
                    - content
                    - business
                    - ddex
                    - validation
                  description: Category of settings
                settings:
                  $ref: '#/components/schemas/DefaultSettingsData'
                priority:
                  type: integer
                  default: 0
                  description: Priority for conflict resolution
            example:
              category: content
              settings:
                content:
                  type: Audio
                  format: Album
                  mainGenre:
                    - Rock
                    - Alternative
                  explicit: clean
                  language: en
              priority: 0
      responses:
        '201':
          description: Default setting created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Default setting created successfully
                  data:
                    $ref: '#/components/schemas/DefaultSetting'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    DefaultSettingsData:
      type: object
      description: The actual settings data organized by category
      properties:
        content:
          type: object
          description: Content-related default settings
          properties:
            type:
              type: string
              enum:
                - Audio
                - Video
                - Ringtone
                - YouTube
              description: Media type
            format:
              type: string
              enum:
                - Single
                - EP
                - Album
                - LP
              description: Release format
            version:
              type: string
              description: Version information (e.g., "Deluxe Edition", "Remastered")
            explicit:
              type: string
              enum:
                - explicit
                - clean
              description: Explicit content flag
            language:
              type: string
              description: Primary language (ISO 639-1 code)
            mainGenre:
              type: array
              items:
                type: string
              description: Primary genre classifications
            subGenre:
              type: array
              items:
                type: string
              description: Secondary genre classifications
            contributors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              description: >-
                Contributors mapped by role (key: role name, value: array of
                contributor names)
        business:
          type: object
          description: Business-related default settings
          properties:
            label:
              type: string
              description: Record label name
            copyright:
              type: string
              description: Copyright notice (e.g., "© 2024 Label Name")
            publisher:
              type: string
              description: Music publisher name
            copyrightOwner:
              type: string
              description: Copyright owner/holder
            distribution:
              type: string
              description: Distribution method or partner
            status:
              type: string
              enum:
                - Live
                - Taken Down
                - Scheduled
                - Pending
                - Error
              description: Default release status
        ddex:
          type: object
          description: DDEX-specific default settings
          properties:
            enableDDEX:
              type: boolean
              description: Enable DDEX message generation
            labelName:
              type: string
              description: Label name for DDEX messages
            resourceReference:
              type: string
              description: Default resource reference pattern
            grid:
              type: string
              description: Global Release Identifier (GRid)
            icpn:
              type: string
              description: International Catalog Product Number
        validation:
          type: object
          description: Validation rules
          properties:
            requireGenre:
              type: boolean
              description: Require genre selection
            requireLyrics:
              type: boolean
              description: Require lyrics for tracks
            requireDescription:
              type: boolean
              description: Require description field
            minimumTrackCount:
              type: integer
              minimum: 0
              description: Minimum number of tracks
            maximumTrackCount:
              type: integer
              minimum: 1
              description: Maximum number of tracks
    DefaultSetting:
      type: object
      description: A default setting entry
      required:
        - id
        - TenantId
        - entityType
        - category
        - settings
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the default setting
        TenantId:
          type: integer
          description: Workspace/tenant identifier
        entityType:
          type: string
          enum:
            - tenant
            - label
            - artist
            - user
            - catalog
          description: Type of entity this setting applies to
        entityId:
          type: string
          format: uuid
          nullable: true
          description: Specific entity ID (null for tenant/catalog-level settings)
        category:
          type: string
          enum:
            - content
            - business
            - ddex
            - validation
          description: Category of settings
        settings:
          $ref: '#/components/schemas/DefaultSettingsData'
        isActive:
          type: boolean
          default: true
          description: Whether this setting is currently active
        priority:
          type: integer
          default: 0
          description: Priority for conflict resolution (higher = higher priority)
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: string
  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
    Conflict:
      description: Conflict - Resource already exists or duplicate constraint violation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: CONFLICT
              message: A default setting for this entity and category already exists
    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}"

````