{
  "components": {
    "schemas": {
      "BacktestMetrics": {
        "properties": {
          "brier_ci_high": {
            "minimum": 0.0,
            "title": "Brier Ci High",
            "type": "number"
          },
          "brier_ci_low": {
            "minimum": 0.0,
            "title": "Brier Ci Low",
            "type": "number"
          },
          "brier_score": {
            "minimum": 0.0,
            "title": "Brier Score",
            "type": "number"
          },
          "calibration_error": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Calibration Error",
            "type": "number"
          },
          "folds": {
            "title": "Folds",
            "type": "integer"
          },
          "interval_coverage": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Interval Coverage",
            "type": "number"
          },
          "model_family": {
            "title": "Model Family",
            "type": "string"
          },
          "vote_share_rmse": {
            "minimum": 0.0,
            "title": "Vote Share Rmse",
            "type": "number"
          }
        },
        "required": [
          "model_family",
          "folds",
          "brier_score",
          "brier_ci_low",
          "brier_ci_high",
          "vote_share_rmse",
          "interval_coverage",
          "calibration_error"
        ],
        "title": "BacktestMetrics",
        "type": "object"
      },
      "CatalogStatus": {
        "properties": {
          "calendar_only": {
            "title": "Calendar Only",
            "type": "integer"
          },
          "eligibility_rule": {
            "title": "Eligibility Rule",
            "type": "string"
          },
          "eligibility_snapshot_sha256": {
            "title": "Eligibility Snapshot Sha256",
            "type": "string"
          },
          "eligibility_version": {
            "title": "Eligibility Version",
            "type": "integer"
          },
          "eligibility_year": {
            "title": "Eligibility Year",
            "type": "integer"
          },
          "eligible_jurisdictions": {
            "title": "Eligible Jurisdictions",
            "type": "integer"
          },
          "forecast_ready": {
            "title": "Forecast Ready",
            "type": "integer"
          },
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "mechanics_blocked": {
            "title": "Mechanics Blocked",
            "type": "integer"
          },
          "schema_version": {
            "title": "Schema Version",
            "type": "integer"
          },
          "sourced_calendars": {
            "title": "Sourced Calendars",
            "type": "integer"
          },
          "total_jurisdictions": {
            "title": "Total Jurisdictions",
            "type": "integer"
          }
        },
        "required": [
          "schema_version",
          "generated_at",
          "eligibility_version",
          "eligibility_year",
          "eligibility_rule",
          "eligibility_snapshot_sha256",
          "eligible_jurisdictions",
          "total_jurisdictions",
          "forecast_ready",
          "calendar_only",
          "mechanics_blocked",
          "sourced_calendars"
        ],
        "title": "CatalogStatus",
        "type": "object"
      },
      "CoalitionForecast": {
        "properties": {
          "majority_probability": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Majority Probability",
            "type": "number"
          },
          "member_ids": {
            "items": {
              "type": "string"
            },
            "title": "Member Ids",
            "type": "array"
          },
          "seats_high": {
            "title": "Seats High",
            "type": "integer"
          },
          "seats_low": {
            "title": "Seats Low",
            "type": "integer"
          },
          "seats_median": {
            "title": "Seats Median",
            "type": "integer"
          }
        },
        "required": [
          "member_ids",
          "majority_probability",
          "seats_median",
          "seats_low",
          "seats_high"
        ],
        "title": "CoalitionForecast",
        "type": "object"
      },
      "CoalitionReport": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "coalitions": {
            "items": {
              "$ref": "#/components/schemas/CoalitionForecast"
            },
            "title": "Coalitions",
            "type": "array"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "majority": {
            "title": "Majority",
            "type": "integer"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          }
        },
        "required": [
          "election_id",
          "snapshot_id",
          "majority",
          "coalitions",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "CoalitionReport",
        "type": "object"
      },
      "Contestant": {
        "properties": {
          "ballot_status": {
            "default": "official",
            "title": "Ballot Status",
            "type": "string"
          },
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis"
          },
          "color": {
            "title": "Color",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "ideology": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ideology"
          },
          "incumbent": {
            "default": false,
            "title": "Incumbent",
            "type": "boolean"
          },
          "leader": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Leader"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "short_name": {
            "title": "Short Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "short_name",
          "color"
        ],
        "title": "Contestant",
        "type": "object"
      },
      "ContestantForecast": {
        "properties": {
          "contestant_id": {
            "title": "Contestant Id",
            "type": "string"
          },
          "projected_seats": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Projected Seats"
          },
          "projected_share": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Projected Share",
            "type": "number"
          },
          "seats_high": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seats High"
          },
          "seats_low": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seats Low"
          },
          "share_high": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Share High",
            "type": "number"
          },
          "share_low": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Share Low",
            "type": "number"
          },
          "win_probability": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Win Probability",
            "type": "number"
          }
        },
        "required": [
          "contestant_id",
          "win_probability",
          "projected_share",
          "share_low",
          "share_high"
        ],
        "title": "ContestantForecast",
        "type": "object"
      },
      "CoverageStatus": {
        "enum": [
          "forecast",
          "calendar_only",
          "mechanics_blocked"
        ],
        "title": "CoverageStatus",
        "type": "string"
      },
      "DriverContribution": {
        "properties": {
          "confidence": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence",
            "type": "number"
          },
          "contribution": {
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Contribution",
            "type": "number"
          },
          "direction": {
            "title": "Direction",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "value",
          "contribution",
          "direction",
          "confidence"
        ],
        "title": "DriverContribution",
        "type": "object"
      },
      "DriverReport": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "drivers": {
            "items": {
              "$ref": "#/components/schemas/DriverContribution"
            },
            "title": "Drivers",
            "type": "array"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "sensitivity": {
            "items": {
              "$ref": "#/components/schemas/DriverSensitivity"
            },
            "title": "Sensitivity",
            "type": "array"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          }
        },
        "required": [
          "election_id",
          "snapshot_id",
          "drivers",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "DriverReport",
        "type": "object"
      },
      "DriverSensitivity": {
        "properties": {
          "clipped": {
            "title": "Clipped",
            "type": "boolean"
          },
          "confidence": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence",
            "type": "number"
          },
          "driver_key": {
            "title": "Driver Key",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "method": {
            "default": "One-at-a-time structural perturbation; all other inputs held constant",
            "title": "Method",
            "type": "string"
          },
          "negative_incumbent_share_shift": {
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Negative Incumbent Share Shift",
            "type": "number"
          },
          "negative_scenario": {
            "default": -1,
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Negative Scenario",
            "type": "number"
          },
          "observed_incumbent_share_shift": {
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Observed Incumbent Share Shift",
            "type": "number"
          },
          "observed_scenario": {
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Observed Scenario",
            "type": "number"
          },
          "positive_incumbent_share_shift": {
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Positive Incumbent Share Shift",
            "type": "number"
          },
          "positive_scenario": {
            "default": 1,
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Positive Scenario",
            "type": "number"
          }
        },
        "required": [
          "driver_key",
          "label",
          "observed_scenario",
          "negative_incumbent_share_shift",
          "observed_incumbent_share_shift",
          "positive_incumbent_share_shift",
          "confidence",
          "clipped"
        ],
        "title": "DriverSensitivity",
        "type": "object"
      },
      "Election": {
        "properties": {
          "contestants": {
            "items": {
              "$ref": "#/components/schemas/Contestant"
            },
            "title": "Contestants",
            "type": "array"
          },
          "date_confidence": {
            "title": "Date Confidence",
            "type": "string"
          },
          "election_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Election Date"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "jurisdiction_id": {
            "title": "Jurisdiction Id",
            "type": "string"
          },
          "last_updated": {
            "format": "date-time",
            "title": "Last Updated",
            "type": "string"
          },
          "majority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Majority"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "potential_candidates": {
            "items": {
              "$ref": "#/components/schemas/Contestant"
            },
            "title": "Potential Candidates",
            "type": "array"
          },
          "seats_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seats Total"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Sources",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "system": {
            "$ref": "#/components/schemas/ElectionSystem"
          },
          "threshold": {
            "default": 0,
            "exclusiveMaximum": 1.0,
            "minimum": 0.0,
            "title": "Threshold",
            "type": "number"
          }
        },
        "required": [
          "id",
          "jurisdiction_id",
          "name",
          "election_date",
          "date_confidence",
          "system",
          "status",
          "last_updated",
          "contestants",
          "sources"
        ],
        "title": "Election",
        "type": "object"
      },
      "ElectionDetail": {
        "properties": {
          "election": {
            "$ref": "#/components/schemas/Election"
          },
          "forecast": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ForecastSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "jurisdiction": {
            "$ref": "#/components/schemas/Jurisdiction"
          }
        },
        "required": [
          "jurisdiction",
          "election",
          "forecast"
        ],
        "title": "ElectionDetail",
        "type": "object"
      },
      "ElectionMechanics": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "forecast_enabled": {
            "title": "Forecast Enabled",
            "type": "boolean"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "rules": {
            "additionalProperties": true,
            "title": "Rules",
            "type": "object"
          },
          "source_adapters": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Source Adapters",
            "type": "array"
          },
          "system": {
            "$ref": "#/components/schemas/ElectionSystem"
          }
        },
        "required": [
          "election_id",
          "system",
          "rules",
          "source_adapters",
          "forecast_enabled",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "ElectionMechanics",
        "type": "object"
      },
      "ElectionSystem": {
        "enum": [
          "unresolved",
          "presidential_plurality",
          "presidential_runoff",
          "fptp",
          "proportional",
          "mixed_member",
          "electoral_college",
          "institutional"
        ],
        "title": "ElectionSystem",
        "type": "string"
      },
      "ForecastSnapshot": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "coalition_outcomes": {
            "items": {
              "$ref": "#/components/schemas/CoalitionForecast"
            },
            "title": "Coalition Outcomes",
            "type": "array"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "driver_sensitivity": {
            "items": {
              "$ref": "#/components/schemas/DriverSensitivity"
            },
            "title": "Driver Sensitivity",
            "type": "array"
          },
          "drivers": {
            "items": {
              "$ref": "#/components/schemas/DriverContribution"
            },
            "title": "Drivers",
            "type": "array"
          },
          "effective_volatility": {
            "default": 0,
            "minimum": 0.0,
            "title": "Effective Volatility",
            "type": "number"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "forecast_horizon_days": {
            "default": 0,
            "minimum": 0.0,
            "title": "Forecast Horizon Days",
            "type": "integer"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "headline": {
            "title": "Headline",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "input_provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Input Provenance",
            "type": "array"
          },
          "input_revision_ids": {
            "items": {
              "type": "string"
            },
            "title": "Input Revision Ids",
            "type": "array"
          },
          "majority_probability": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Majority Probability",
            "type": "number"
          },
          "methodology_url": {
            "title": "Methodology Url",
            "type": "string"
          },
          "missing_drivers": {
            "items": {
              "type": "string"
            },
            "title": "Missing Drivers",
            "type": "array"
          },
          "model_family": {
            "title": "Model Family",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/ContestantForecast"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "poll_weight_used": {
            "anyOf": [
              {
                "maximum": 1.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Poll Weight Used"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "regional_forecast_supported": {
            "title": "Regional Forecast Supported",
            "type": "boolean"
          },
          "scenario_outcomes": {
            "items": {
              "$ref": "#/components/schemas/ScenarioForecast"
            },
            "title": "Scenario Outcomes",
            "type": "array"
          },
          "seed": {
            "title": "Seed",
            "type": "integer"
          },
          "selection_status": {
            "title": "Selection Status",
            "type": "string"
          },
          "simulation_count": {
            "maximum": 1000000.0,
            "minimum": 1000000.0,
            "title": "Simulation Count",
            "type": "integer"
          },
          "turnout_median": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Turnout Median",
            "type": "number"
          },
          "uncertainty_scale": {
            "default": 1,
            "exclusiveMinimum": 0.0,
            "title": "Uncertainty Scale",
            "type": "number"
          }
        },
        "required": [
          "id",
          "election_id",
          "as_of",
          "published_at",
          "model_version",
          "model_family",
          "selection_status",
          "simulation_count",
          "seed",
          "data_quality",
          "freshness",
          "missing_drivers",
          "regional_forecast_supported",
          "headline",
          "majority_probability",
          "turnout_median",
          "outcomes",
          "coalition_outcomes",
          "drivers",
          "methodology_url",
          "input_provenance",
          "provenance"
        ],
        "title": "ForecastSnapshot",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "Health": {
        "properties": {
          "dependencies": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Dependencies",
            "type": "object"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "title": "Timestamp",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "status",
          "version",
          "timestamp"
        ],
        "title": "Health",
        "type": "object"
      },
      "Jurisdiction": {
        "properties": {
          "blocking_reasons": {
            "items": {
              "type": "string"
            },
            "title": "Blocking Reasons",
            "type": "array"
          },
          "coverage_status": {
            "$ref": "#/components/schemas/CoverageStatus",
            "default": "mechanics_blocked"
          },
          "eligibility": {
            "title": "Eligibility",
            "type": "string"
          },
          "flag": {
            "title": "Flag",
            "type": "string"
          },
          "forecast_enabled": {
            "default": true,
            "title": "Forecast Enabled",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_exception": {
            "default": false,
            "title": "Is Exception",
            "type": "boolean"
          },
          "iso3": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iso3"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "region": {
            "title": "Region",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "region",
          "eligibility",
          "flag"
        ],
        "title": "Jurisdiction",
        "type": "object"
      },
      "MapLayer": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "geojson": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geojson"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "supported": {
            "title": "Supported",
            "type": "boolean"
          }
        },
        "required": [
          "election_id",
          "supported",
          "reason",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "MapLayer",
        "type": "object"
      },
      "ModelComparison": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "dataset_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataset Sha256"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "evaluated_horizon_max_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluated Horizon Max Days"
          },
          "evaluated_horizon_min_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluated Horizon Min Days"
          },
          "evaluation_period_end": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluation Period End"
          },
          "evaluation_period_start": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluation Period Start"
          },
          "fitted_poll_weight": {
            "anyOf": [
              {
                "maximum": 1.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fitted Poll Weight"
          },
          "fold_count": {
            "default": 0,
            "title": "Fold Count",
            "type": "integer"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "held_out_election_count": {
            "default": 0,
            "title": "Held Out Election Count",
            "type": "integer"
          },
          "historical_election_count": {
            "default": 0,
            "minimum": 0.0,
            "title": "Historical Election Count",
            "type": "integer"
          },
          "historical_leader": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Historical Leader"
          },
          "historical_span_years": {
            "default": 0,
            "minimum": 0.0,
            "title": "Historical Span Years",
            "type": "integer"
          },
          "leakage_check": {
            "title": "Leakage Check",
            "type": "boolean"
          },
          "maximum_held_out_elections": {
            "default": 0,
            "minimum": 0.0,
            "title": "Maximum Held Out Elections",
            "type": "integer"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "metrics": {
            "items": {
              "$ref": "#/components/schemas/BacktestMetrics"
            },
            "title": "Metrics",
            "type": "array"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "selection_rule": {
            "title": "Selection Rule",
            "type": "string"
          },
          "simulation_count_per_model_fold": {
            "default": 0,
            "minimum": 0.0,
            "title": "Simulation Count Per Model Fold",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "target_horizon_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Horizon Days"
          },
          "validation_constraints": {
            "items": {
              "type": "string"
            },
            "title": "Validation Constraints",
            "type": "array"
          },
          "vintage_verified": {
            "default": false,
            "title": "Vintage Verified",
            "type": "boolean"
          },
          "winner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winner"
          }
        },
        "required": [
          "election_id",
          "status",
          "winner",
          "selection_rule",
          "metrics",
          "leakage_check",
          "message",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "ModelComparison",
        "type": "object"
      },
      "OfficialResults": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "feed_available": {
            "title": "Feed Available",
            "type": "boolean"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "reporting_fraction": {
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Reporting Fraction",
            "type": "number"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Results",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "election_id",
          "feed_available",
          "status",
          "reporting_fraction",
          "results",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "OfficialResults",
        "type": "object"
      },
      "QualityGrade": {
        "enum": [
          "A",
          "B",
          "C",
          "D"
        ],
        "title": "QualityGrade",
        "type": "string"
      },
      "ScenarioForecast": {
        "properties": {
          "assumption": {
            "title": "Assumption",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/ContestantForecast"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "scenario_id": {
            "title": "Scenario Id",
            "type": "string"
          },
          "source_ids": {
            "items": {
              "type": "string"
            },
            "title": "Source Ids",
            "type": "array"
          },
          "weight": {
            "exclusiveMinimum": 0.0,
            "maximum": 1.0,
            "title": "Weight",
            "type": "number"
          }
        },
        "required": [
          "scenario_id",
          "label",
          "weight",
          "assumption",
          "outcomes"
        ],
        "title": "ScenarioForecast",
        "type": "object"
      },
      "SimulationSummary": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "model_family": {
            "title": "Model Family",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/ContestantForecast"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "seed": {
            "title": "Seed",
            "type": "integer"
          },
          "simulation_count": {
            "maximum": 1000000.0,
            "minimum": 1000000.0,
            "title": "Simulation Count",
            "type": "integer"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          }
        },
        "required": [
          "snapshot_id",
          "election_id",
          "model_family",
          "simulation_count",
          "seed",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "outcomes",
          "provenance"
        ],
        "title": "SimulationSummary",
        "type": "object"
      },
      "SourceLedger": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "data_quality": {
            "$ref": "#/components/schemas/QualityGrade"
          },
          "election_id": {
            "title": "Election Id",
            "type": "string"
          },
          "freshness": {
            "title": "Freshness",
            "type": "string"
          },
          "model_version": {
            "title": "Model Version",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Provenance",
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceRef"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "required": [
          "election_id",
          "sources",
          "as_of",
          "published_at",
          "model_version",
          "data_quality",
          "freshness",
          "provenance"
        ],
        "title": "SourceLedger",
        "type": "object"
      },
      "SourceRef": {
        "properties": {
          "authority": {
            "title": "Authority",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "license": {
            "title": "License",
            "type": "string"
          },
          "license_url": {
            "title": "License Url",
            "type": "string"
          },
          "retrieved_at": {
            "format": "date-time",
            "title": "Retrieved At",
            "type": "string"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "source_id",
          "label",
          "url",
          "authority",
          "retrieved_at",
          "license",
          "license_url"
        ],
        "title": "SourceRef",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Versioned election catalog and probabilistic forecast interface.",
    "title": "Elexion Global API",
    "version": "0.2.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/health": {
      "get": {
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health",
        "tags": [
          "operations"
        ]
      }
    },
    "/metrics": {
      "get": {
        "operationId": "metrics_metrics_get",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Metrics",
        "tags": [
          "operations"
        ]
      }
    },
    "/v1/catalog/status": {
      "get": {
        "operationId": "catalog_status_v1_catalog_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Catalog Status",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/elections": {
      "get": {
        "operationId": "elections_v1_elections_get",
        "parameters": [
          {
            "in": "query",
            "name": "jurisdiction",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Jurisdiction"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Election"
                  },
                  "title": "Response Elections V1 Elections Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Elections",
        "tags": [
          "calendar"
        ]
      }
    },
    "/v1/elections/{election_id}": {
      "get": {
        "operationId": "election_detail_v1_elections__election_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElectionDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Election Detail",
        "tags": [
          "forecast"
        ]
      }
    },
    "/v1/elections/{election_id}/backtests": {
      "get": {
        "operationId": "backtests_v1_elections__election_id__backtests_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelComparison"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Backtests",
        "tags": [
          "backtests"
        ]
      }
    },
    "/v1/elections/{election_id}/coalitions": {
      "get": {
        "operationId": "coalitions_v1_elections__election_id__coalitions_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoalitionReport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Coalitions",
        "tags": [
          "simulations"
        ]
      }
    },
    "/v1/elections/{election_id}/drivers": {
      "get": {
        "operationId": "drivers_v1_elections__election_id__drivers_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriverReport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Drivers",
        "tags": [
          "drivers"
        ]
      }
    },
    "/v1/elections/{election_id}/forecast": {
      "get": {
        "operationId": "forecast_v1_elections__election_id__forecast_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastSnapshot"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forecast",
        "tags": [
          "forecast"
        ]
      }
    },
    "/v1/elections/{election_id}/forecast/alternatives/{model_family}": {
      "get": {
        "operationId": "alternative_forecast_v1_elections__election_id__forecast_alternatives__model_family__get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "model_family",
            "required": true,
            "schema": {
              "title": "Model Family",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastSnapshot"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Alternative Forecast",
        "tags": [
          "forecast"
        ]
      }
    },
    "/v1/elections/{election_id}/forecasts": {
      "get": {
        "operationId": "forecast_history_v1_elections__election_id__forecasts_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ForecastSnapshot"
                  },
                  "title": "Response Forecast History V1 Elections  Election Id  Forecasts Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forecast History",
        "tags": [
          "forecast"
        ]
      }
    },
    "/v1/elections/{election_id}/map-layers": {
      "get": {
        "operationId": "map_layers_v1_elections__election_id__map_layers_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapLayer"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Map Layers",
        "tags": [
          "maps"
        ]
      }
    },
    "/v1/elections/{election_id}/mechanics": {
      "get": {
        "operationId": "mechanics_v1_elections__election_id__mechanics_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElectionMechanics"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mechanics",
        "tags": [
          "calendar"
        ]
      }
    },
    "/v1/elections/{election_id}/model-comparison": {
      "get": {
        "operationId": "model_comparison_v1_elections__election_id__model_comparison_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelComparison"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Model Comparison",
        "tags": [
          "backtests"
        ]
      }
    },
    "/v1/elections/{election_id}/official-results": {
      "get": {
        "operationId": "official_results_v1_elections__election_id__official_results_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficialResults"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Official Results",
        "tags": [
          "results"
        ]
      }
    },
    "/v1/elections/{election_id}/simulations": {
      "get": {
        "operationId": "simulation_summary_v1_elections__election_id__simulations_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulationSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Simulation Summary",
        "tags": [
          "simulations"
        ]
      }
    },
    "/v1/elections/{election_id}/sources": {
      "get": {
        "operationId": "sources_v1_elections__election_id__sources_get",
        "parameters": [
          {
            "in": "path",
            "name": "election_id",
            "required": true,
            "schema": {
              "title": "Election Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceLedger"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sources",
        "tags": [
          "sources"
        ]
      }
    },
    "/v1/forecast-snapshots/{snapshot_id}": {
      "get": {
        "operationId": "forecast_snapshot_v1_forecast_snapshots__snapshot_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastSnapshot"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forecast Snapshot",
        "tags": [
          "forecast"
        ]
      }
    },
    "/v1/jurisdictions": {
      "get": {
        "operationId": "jurisdictions_v1_jurisdictions_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Jurisdiction"
                  },
                  "title": "Response Jurisdictions V1 Jurisdictions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Jurisdictions",
        "tags": [
          "catalog"
        ]
      }
    },
    "/v1/stream": {
      "get": {
        "operationId": "stream_v1_stream_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stream",
        "tags": [
          "live"
        ]
      }
    }
  }
}
