{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jellypod-com/json-schema/jellypod-com-podcast-analytics-schema.json",
  "title": "PodcastAnalytics",
  "description": "Streaming metrics for a podcast: combined totals, per-app download breakdown, and per-episode metrics.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/jellypod-com-api-openapi.json#/components/schemas/PodcastAnalytics",
  "type": "object",
  "properties": {
    "analytics_enabled": {
      "type": "boolean",
      "description": "Whether download tracking is enabled. When false, audio metrics are 0."
    },
    "as_of": {
      "type": "string",
      "description": "ISO-8601 time these metrics were computed.",
      "readOnly": true
    },
    "complete": {
      "type": "boolean",
      "description": "Whether every analytics source answered in full. When false an upstream (OP3 or Mux) was degraded, so the numbers are a floor rather than a total; retry later for a complete read.",
      "readOnly": true
    },
    "episodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "downloads": {
            "type": "object",
            "properties": {
              "first_7_days": {
                "type": "number",
                "minimum": 0,
                "description": "Audio downloads in the first 7 days after publish."
              },
              "first_30_days": {
                "type": "number",
                "minimum": 0,
                "description": "Audio downloads in the first 30 days after publish."
              },
              "total": {
                "type": "number",
                "minimum": 0,
                "description": "All-time audio downloads (OP3)."
              }
            },
            "required": [
              "first_7_days",
              "first_30_days",
              "total"
            ]
          },
          "video_views": {
            "type": "object",
            "properties": {
              "last_7_days": {
                "type": "number",
                "minimum": 0,
                "description": "Web video views in the last 7 days."
              },
              "last_30_days": {
                "type": "number",
                "minimum": 0,
                "description": "Web video views in the last 30 days."
              },
              "total": {
                "type": "number",
                "minimum": 0,
                "description": "Web video views over the last 90 days (Mux retention window)."
              }
            },
            "required": [
              "last_7_days",
              "last_30_days",
              "total"
            ]
          },
          "episode_id": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          }
        },
        "required": [
          "downloads",
          "video_views",
          "episode_id"
        ]
      }
    },
    "plays_by_app": {
      "type": "object",
      "additionalProperties": {
        "type": "number",
        "minimum": 0
      },
      "description": "Audio downloads grouped by client app (Spotify, Apple Podcasts, Overcast, ...). Show-level."
    },
    "podcast_id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "totals": {
      "type": "object",
      "properties": {
        "downloads": {
          "type": "number",
          "minimum": 0,
          "description": "All-time audio downloads (OP3)."
        },
        "last_7_days": {
          "type": "number",
          "minimum": 0,
          "description": "Combined plays in the last 7 days."
        },
        "last_30_days": {
          "type": "number",
          "minimum": 0,
          "description": "Combined plays in the last 30 days."
        },
        "plays": {
          "type": "number",
          "minimum": 0,
          "description": "All-time audio downloads + web video views."
        },
        "video_views": {
          "type": "number",
          "minimum": 0,
          "description": "Web video views (Mux, last 90 days)."
        }
      },
      "required": [
        "downloads",
        "last_7_days",
        "last_30_days",
        "plays",
        "video_views"
      ]
    }
  },
  "required": [
    "analytics_enabled",
    "as_of",
    "complete",
    "episodes",
    "plays_by_app",
    "podcast_id",
    "totals"
  ]
}