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

> **/split/default**

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

## Description

**/split/default**

**Description:**\
The `/split/default` endpoint creates splits using either provided shares or an artist's default splits. It automatically associates the split with an asset or product and validates that the total share equals 100%.

**Method:**\
`POST`

**Request Body:**

The request body should be a JSON object with the following properties. Either `assetId` or `productId` is required.

| Parameter | Type   | Required    | Description                                                                  |
| --------- | ------ | ----------- | ---------------------------------------------------------------------------- |
| split     | array  | No          | Array of split share objects (if not provided, uses artist's default splits) |
| assetId   | string | Conditional | UUID of the asset to create splits for (required if productId not provided)  |
| productId | string | Conditional | UUID of the product to create splits for (required if assetId not provided)  |
| type      | string | No          | Type of split (defaults to 'default' if not provided)                        |

**Split Share Object:**

| Parameter | Type   | Required | Description                                          |
| --------- | ------ | -------- | ---------------------------------------------------- |
| user      | string | Yes      | UUID of the user                                     |
| share     | number | Yes      | Percentage share (must total 100% across all shares) |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/split/default', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "split": [
        {
          "user": "sample-user",
          "share": 1
        }
      ],
      "assetId": "sample-assetId",
      "productId": "sample-productId",
      "type": "sample-type"
    })
  });

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

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

  response = requests.post(
    'https://api.royalti.io/split/default',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"split":[{"user":"sample-user","share":1}],"assetId":"sample-assetId","productId":"sample-productId","type":"sample-type"}
  )

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

  ```bash cURL theme={null}
  curl -X POST https://api.royalti.io/split/default \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"split":[{"user":"sample-user","share":1}],"assetId":"sample-assetId","productId":"sample-productId","type":"sample-type"}'

  ```
</CodeGroup>


## OpenAPI

````yaml post /split/default
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:
  /split/default:
    post:
      tags:
        - Splits
      summary: Create Default Splits
      description: >-
        **/split/default**


        **Description:**  

        The `/split/default` endpoint creates splits using either provided
        shares or an artist's default splits. It automatically associates the
        split with an asset or product and validates that the total share equals
        100%.


        **Method:**  

        `POST`


        **Request Body:**


        The request body should be a JSON object with the following properties.
        Either `assetId` or `productId` is required.


        | Parameter | Type | Required | Description |

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

        | split | array | No | Array of split share objects (if not provided,
        uses artist's default splits) |

        | assetId | string | Conditional | UUID of the asset to create splits
        for (required if productId not provided) |

        | productId | string | Conditional | UUID of the product to create
        splits for (required if assetId not provided) |

        | type | string | No | Type of split (defaults to 'default' if not
        provided) |


        **Split Share Object:**


        | Parameter | Type | Required | Description |

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

        | user | string | Yes | UUID of the user |

        | share | number | Yes | Percentage share (must total 100% across all
        shares) |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                split:
                  type: array
                  items:
                    type: object
                    properties:
                      user:
                        type: string
                        format: uuid
                        description: UUID of the user
                      share:
                        type: number
                        description: Percentage share (must total 100% across all shares)
                        minimum: 0
                        maximum: 100
                    required:
                      - user
                      - share
                  description: Array of split share objects
                assetId:
                  type: string
                  format: uuid
                  description: >-
                    UUID of the asset to create splits for (required if
                    productId not provided)
                productId:
                  type: string
                  format: uuid
                  description: >-
                    UUID of the product to create splits for (required if
                    assetId not provided)
                type:
                  type: string
                  description: Type of split (defaults to 'default' if not provided)
                  default: default
              anyOf:
                - required:
                    - assetId
                - required:
                    - productId
            examples:
              With custom splits:
                summary: Create with custom splits
                value:
                  assetId: d1c5b49e-95fa-4aed-930e-cf314c16a53d
                  type: Publishing
                  split:
                    - user: cf960b5a-37cd-484a-b461-0b191b09bed1
                      share: 60
                    - user: 4e39b347-7db0-417d-a5bc-3d8493c9ce19
                      share: 40
              Using artist defaults:
                summary: Use artist's default splits
                value:
                  productId: b53230c5-2110-40ce-abe5-2112724ffb53
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Split created successfully
                  split:
                    $ref: '#/components/schemas/Split'
                  source:
                    type: string
                    enum:
                      - manual
                      - artist_default
                    description: >-
                      Indicates whether the split was created from manual input
                      or artist defaults
              example:
                message: Split created successfully
                split:
                  id: 550e8400-e29b-41d4-a716-446655440000
                  name: Default Split - Song Title (ISRC12345678)
                  type: Publishing
                  AssetId: d1c5b49e-95fa-4aed-930e-cf314c16a53d
                  ProductId: null
                  createdAt: '2023-06-01T12:00:00.000Z'
                  updatedAt: '2023-06-01T12:00:00.000Z'
                source: manual
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Missing required field:
                  value:
                    status: error
                    message: Either assetId or productId is required
                Invalid split total:
                  value:
                    status: error
                    message: 'Split must equal 100. Current total: 90'
                No artist found:
                  value:
                    status: error
                    message: Asset not found or has no associated artists
                No default splits:
                  value:
                    status: error
                    message: >-
                      No default splits found for artist. Please provide splits
                      in request body.
                Split exists:
                  value:
                    status: error
                    message: Default split already exists for this asset
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Split:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the split configuration
        AssetId:
          type: string
          format: uuid
          description: The unique identifier of the asset
        ProductId:
          type: string
          format: uuid
          description: The unique identifier of the product
        name:
          type: string
          description: The name or description of the revenue split
        type:
          type: string
          nullable: true
          enum:
            - ' '
            - Publishing
            - YouTube
            - Live
          description: The type of revenue (e.g., Publishing, YouTube, Live)
        startDate:
          type: string
          format: date
          nullable: true
          description: The start date of the split period (inclusive)
        endDate:
          type: string
          format: date
          nullable: true
          description: The end date of the split period (exclusive)
        SplitShares:
          type: array
          items:
            type: object
            properties:
              TenantUserId:
                type: string
                format: uuid
              Share:
                type: number
              TenantUser:
                type: object
                properties:
                  firstName:
                    type: string
                  lastName:
                    type: string
                  ipi:
                    type: string
                    nullable: true
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/SplitCondition'
        contract:
          type: string
          nullable: true
        ContractId:
          type: string
          format: uuid
          nullable: true
        memo:
          type: string
          nullable: true
        Asset:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            displayArtist:
              type: string
            isrc:
              type: string
            title:
              type: string
            version:
              type: string
              nullable: true
        Product:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            displayArtist:
              type: string
            upc:
              type: string
            title:
              type: string
        coverage:
          $ref: '#/components/schemas/CoverageInfo'
          description: Temporal coverage analysis (included when includeCoverage=true)
        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
    SplitCondition:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the condition
        mode:
          type: string
          enum:
            - include
            - exclude
          description: Whether to include or exclude the specified criteria
        memo:
          type: string
          nullable: true
          description: Additional notes about the condition
        territories:
          type: array
          items:
            type: string
          nullable: true
          description: Array of ISO country codes
        dsps:
          type: array
          items:
            type: string
          nullable: true
          description: Array of DSP identifiers
        usageTypes:
          type: array
          items:
            type: string
          nullable: true
          description: Array of usage type identifiers
        customDimension:
          type: string
          nullable: true
          description: Custom dimension key
        customValues:
          type: array
          items:
            type: string
          nullable: true
          description: Custom dimension values
    CoverageInfo:
      type: object
      properties:
        overlapping:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              type:
                type: string
                nullable: true
              startDate:
                type: string
                format: date
                nullable: true
              endDate:
                type: string
                format: date
                nullable: true
          description: Splits that overlap with the current split
        adjacent:
          type: object
          properties:
            predecessor:
              type: object
              nullable: true
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                type:
                  type: string
                  nullable: true
                endDate:
                  type: string
                  format: date
            successor:
              type: object
              nullable: true
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                type:
                  type: string
                  nullable: true
                startDate:
                  type: string
                  format: date
          description: >-
            Adjacent splits (predecessor ends when current starts, successor
            starts when current ends)
        gaps:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - before
                  - after
                  - between
                  - infinite
              description:
                type: string
              startDate:
                type: string
                format: date
                nullable: true
              endDate:
                type: string
                format: date
                nullable: true
          description: Gaps in temporal coverage
        defaultSplits:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              type:
                type: string
                nullable: true
          description: Default splits that provide fallback coverage
        summary:
          type: object
          properties:
            hasOverlaps:
              type: boolean
            hasPredecessor:
              type: boolean
            hasSuccessor:
              type: boolean
            hasGaps:
              type: boolean
            isOpenEnded:
              type: boolean
            hasDefaultSplit:
              type: boolean
          description: Summary flags for quick coverage analysis
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````