{
  "lexicon": 1,
  "id": "tools.ozone.report.getHistoricalStats",
  "defs": {
    "main": {
      "type": "query",
      "description": "Get historical daily report statistics. Returns a paginated list of daily stat snapshots, newest first. Filter by queue, moderator, or report type.",
      "parameters": {
        "type": "params",
        "properties": {
          "queueId": {
            "type": "integer",
            "description": "Filter stats by queue. Use -1 for unqueued reports."
          },
          "moderatorDid": {
            "type": "string",
            "format": "did",
            "description": "Filter stats by moderator DID."
          },
          "reportTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Filter stats by report types."
          },
          "startDate": {
            "type": "string",
            "format": "datetime",
            "description": "Earliest date to include (inclusive)."
          },
          "endDate": {
            "type": "string",
            "format": "datetime",
            "description": "Latest date to include (inclusive)."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 30,
            "description": "Maximum number of entries to return."
          },
          "cursor": {
            "type": "string",
            "description": "Pagination cursor."
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["stats"],
          "properties": {
            "stats": {
              "type": "array",
              "items": {
                "type": "ref",
                "ref": "tools.ozone.report.defs#historicalStats"
              }
            },
            "cursor": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
