{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mantic/json-schema/mantic-scenario-suggestions-response-schema.json",
  "title": "ScenarioSuggestionsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mantic-scenarios-api-openapi.yml#/components/schemas/ScenarioSuggestionsResponse",
  "properties": {
    "candidates": {
      "items": {
        "$ref": "#/$defs/ScenarioSuggestion"
      },
      "type": "array",
      "title": "Candidates"
    },
    "status": {
      "type": "string",
      "enum": [
        "ready",
        "building"
      ],
      "title": "Status"
    },
    "latest_run_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Latest Run Status"
    },
    "retry_after": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retry After"
    }
  },
  "type": "object",
  "required": [
    "candidates",
    "status"
  ],
  "$defs": {
    "ScenarioSuggestion": {
      "properties": {
        "run_id": {
          "type": "integer",
          "title": "Run Id"
        },
        "index": {
          "type": "integer",
          "title": "Index"
        },
        "condition_statement": {
          "type": "string",
          "title": "Condition Statement"
        },
        "event_label": {
          "type": "string",
          "title": "Event Label"
        },
        "resolution_event": {
          "type": "string",
          "title": "Resolution Event"
        },
        "expected_resolution_date": {
          "type": "string",
          "title": "Expected Resolution Date"
        },
        "causal_rationale": {
          "type": "string",
          "title": "Causal Rationale"
        },
        "condition_output_type": {
          "type": "string",
          "title": "Condition Output Type"
        },
        "threshold_comparator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Threshold Comparator"
        },
        "threshold_numeric": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Threshold Numeric"
        },
        "threshold_date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Threshold Date"
        },
        "numerical_range_min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numerical Range Min"
        },
        "numerical_range_max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numerical Range Max"
        },
        "numerical_unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numerical Unit"
        },
        "short_label_if_yes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Short Label If Yes"
        },
        "short_label_if_no": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Short Label If No"
        },
        "existing_question_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Existing Question Id"
        }
      },
      "type": "object",
      "required": [
        "run_id",
        "index",
        "condition_statement",
        "event_label",
        "resolution_event",
        "expected_resolution_date",
        "causal_rationale",
        "condition_output_type"
      ],
      "title": "ScenarioSuggestion",
      "description": "A pooled candidate the viewer may add to their scenarios."
    }
  }
}