{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dynamoi-com/json-schema/dynamoi-com-paid-data-bundle-schema.json",
  "title": "PaidDataBundle",
  "description": "format=json body: the bundle envelope with one immutable artifact per family. Rows carry rights_category and usage_category as separate fields.",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dynamoi-com-openapi.json#/components/schemas/PaidDataBundle",
  "additionalProperties": false,
  "properties": {
    "bundleFormatVersion": {
      "type": "string"
    },
    "families": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "artifact": {
            "$ref": "#/$defs/PaidDataFamilyArtifact"
          },
          "publicationHash": {
            "pattern": "^[a-f0-9]{64}$",
            "type": "string"
          },
          "publicationId": {
            "type": "string"
          }
        },
        "required": [
          "artifact",
          "publicationHash",
          "publicationId"
        ],
        "type": "object"
      },
      "maxItems": 5,
      "minItems": 1,
      "type": "array"
    },
    "licenseVersion": {
      "type": "string"
    },
    "methodologyVersion": {
      "type": "string"
    },
    "taxonomyVersion": {
      "type": "string"
    }
  },
  "required": [
    "bundleFormatVersion",
    "families",
    "licenseVersion",
    "methodologyVersion",
    "taxonomyVersion"
  ],
  "type": "object",
  "$defs": {
    "PaidDataFamilyArtifact": {
      "type": "object",
      "properties": {
        "familySlug": {
          "type": "string",
          "enum": [
            "master-streaming-rpm",
            "publishing-mechanical-rpm",
            "publishing-performance-rpm",
            "youtube-publishing-rpm",
            "youtube-adsense-rpm"
          ]
        },
        "formatVersion": {
          "type": "string",
          "const": "paid-data-family-v1"
        },
        "licenseVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "methodologyVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "rows": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "countryCode": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "countryLabel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "genreSlug": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              },
              "rights_category": {
                "type": "string",
                "enum": [
                  "sound_recording_master",
                  "musical_work_mechanical",
                  "musical_work_performance",
                  "channel_owner_advertising"
                ]
              },
              "rpmUsdPerThousand": {
                "type": "number",
                "minimum": 0
              },
              "serviceLabel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "serviceSlug": {
                "type": "string",
                "maxLength": 128,
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              },
              "usage_category": {
                "type": "string",
                "enum": [
                  "interactive_audio_streaming",
                  "youtube_video",
                  "youtube_monetized_video"
                ]
              },
              "windowStartMonth": {
                "type": "string",
                "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
              },
              "windowThroughMonth": {
                "type": "string",
                "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
              }
            },
            "required": [
              "countryCode",
              "countryLabel",
              "rights_category",
              "rpmUsdPerThousand",
              "serviceLabel",
              "serviceSlug",
              "usage_category",
              "windowStartMonth",
              "windowThroughMonth"
            ],
            "additionalProperties": false
          }
        },
        "sourceCutoff": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "taxonomyVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "required": [
        "familySlug",
        "formatVersion",
        "licenseVersion",
        "methodologyVersion",
        "rows",
        "sourceCutoff",
        "taxonomyVersion"
      ],
      "additionalProperties": false
    }
  }
}