{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-proof-of-play-report-schema.json",
  "title": "ProofOfPlayReport",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-proof-api-openapi.yml#/components/schemas/ProofOfPlayReport",
  "type": "object",
  "properties": {
    "totals": {
      "type": "object",
      "properties": {
        "plays": {
          "type": "integer",
          "description": "Successful plays (neither skipped nor failed)."
        },
        "skipped": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "events": {
          "type": "integer",
          "description": "Every playback-end event: plays + skipped + failed."
        },
        "uniqueContent": {
          "type": "integer"
        },
        "screensReporting": {
          "type": "integer"
        }
      },
      "required": [
        "plays",
        "skipped",
        "failed",
        "events",
        "uniqueContent",
        "screensReporting"
      ]
    },
    "byContent": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contentId": {
            "type": "string",
            "description": "`unknown` when the player did not report one."
          },
          "contentName": {
            "type": "string",
            "description": "Falls back to the id when no name was reported."
          },
          "contentKind": {
            "type": "string",
            "description": "`media`, `app`, `creative`, …; `media` for days read from the daily rollup."
          },
          "screenName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set only when exactly one screen played it."
          },
          "played": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "screenCount": {
            "type": "integer"
          },
          "totalDurationSec": {
            "type": "integer"
          },
          "firstAt": {
            "type": "string",
            "description": "ISO-8601 timestamp (UTC)."
          },
          "lastAt": {
            "type": "string",
            "description": "ISO-8601 timestamp (UTC)."
          }
        },
        "required": [
          "contentId",
          "contentName",
          "contentKind",
          "screenName",
          "played",
          "skipped",
          "failed",
          "screenCount",
          "totalDurationSec",
          "firstAt",
          "lastAt"
        ]
      },
      "description": "Per content, most successful plays first."
    },
    "screens": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "description": "Screens that reported in the window, by name."
    },
    "from": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "to": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "retentionDays": {
      "type": "integer",
      "description": "How far back raw play events exist; older days come from the daily rollup."
    },
    "truncated": {
      "type": "boolean",
      "description": "Always false: the whole window is counted."
    },
    "fromRollup": {
      "type": "boolean",
      "description": "Part of the window was read from the daily rollup."
    }
  },
  "required": [
    "totals",
    "byContent",
    "screens",
    "from",
    "to",
    "retentionDays",
    "truncated",
    "fromRollup"
  ]
}