{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mantic/json-schema/mantic-categorical-question-response-schema.json",
  "title": "CategoricalQuestionResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mantic-openapi.json#/components/schemas/CategoricalQuestionResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "declarative_title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Declarative Title"
    },
    "type": {
      "$ref": "#/$defs/OutputType"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "resolution_criteria": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolution Criteria"
    },
    "resolution_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolution Time"
    },
    "schedule": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScheduleEnum"
        },
        {
          "type": "null"
        }
      ]
    },
    "schedule_end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule End Date"
    },
    "keep_active": {
      "type": "boolean",
      "title": "Keep Active",
      "default": false
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "added_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Added At"
    },
    "created_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "can_run_forecast": {
      "type": "boolean",
      "title": "Can Run Forecast",
      "description": "Whether the user may enqueue a forecast for this question.",
      "default": true
    },
    "refresh_available_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Refresh Available At",
      "description": "When the user may next enqueue a live forecast without added context, or null when no wait applies."
    },
    "liked": {
      "type": "boolean",
      "title": "Liked",
      "default": false
    },
    "disliked": {
      "type": "boolean",
      "title": "Disliked",
      "default": false
    },
    "is_resolved": {
      "type": "boolean",
      "title": "Is Resolved",
      "default": false
    },
    "resolved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolved At"
    },
    "resolved_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolved By"
    },
    "resolution_notes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolution Notes"
    },
    "resolved_value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolved Value"
    },
    "resolution_source": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResolutionSourceResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Publisher attribution for a question the scheduled-question registry resolved from its source series. Populated only by `/webapp/question/{id}`."
    },
    "resolution_citations": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResolutionCitations"
        },
        {
          "type": "null"
        }
      ],
      "description": "The cited rationale of the resolution agent verdict that resolved the question. Populated only by `/webapp/question/{id}`."
    },
    "is_scheduled_instance": {
      "type": "boolean",
      "title": "Is Scheduled Instance",
      "description": "Whether a scheduled-question family generated this question, so the release pipeline owns its `is_active` and `superseded_by`. Populated only by `/webapp/question/{id}`.",
      "default": false
    },
    "additional_information": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional Information"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags"
    },
    "groups": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Groups"
    },
    "group_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Group Ids"
    },
    "group_positions": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "Group Positions"
    },
    "superseded_by": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Superseded By"
    },
    "conditional_forecasting_enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conditional Forecasting Enabled"
    },
    "conditional_forecasting_effective": {
      "type": "boolean",
      "title": "Conditional Forecasting Effective",
      "default": false
    },
    "conditional_forecasting_eligible": {
      "type": "boolean",
      "title": "Conditional Forecasting Eligible",
      "default": false
    },
    "ship_2_output_mode": {
      "anyOf": [
        {
          "$ref": "#/$defs/Ship2OutputMode"
        },
        {
          "type": "null"
        }
      ]
    },
    "supports_cash_out": {
      "type": "boolean",
      "title": "Supports Cash Out",
      "description": "Whether the latest execution's forecast can be cashed out at a user-chosen deadline. Always false on list responses.",
      "default": false
    },
    "cash_out_deadline": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cash Out Deadline",
      "description": "Default cash-out deadline for this question: the latest execution's event_happens_window_close_time / window_close_time / scheduled_resolve_time, falling back to resolution_time. Always null on list responses."
    },
    "categories": {
      "items": {
        "$ref": "#/$defs/CategoryResponse"
      },
      "type": "array",
      "title": "Categories"
    }
  },
  "type": "object",
  "required": [
    "id",
    "title",
    "type",
    "created_at",
    "is_active",
    "categories"
  ],
  "$defs": {
    "CategoryResponse": {
      "properties": {
        "category_id": {
          "type": "integer",
          "title": "Category Id"
        },
        "category_title": {
          "type": "string",
          "title": "Category Title"
        }
      },
      "type": "object",
      "required": [
        "category_id",
        "category_title"
      ],
      "title": "CategoryResponse"
    },
    "DecompositionSource": {
      "properties": {
        "finding": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finding"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "source_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Name"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "DecompositionSource",
      "description": "One read source behind a component, with the finding it supplied when one was recorded."
    },
    "DecompositionTextPart": {
      "properties": {
        "text": {
          "type": "string",
          "title": "Text"
        },
        "ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ref",
          "description": "The step `ref` or input name the text stands for, if any"
        },
        "source": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source",
          "description": "The number, from 1, of the option's source the text cites"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "text"
      ],
      "title": "DecompositionTextPart",
      "description": "A run of equation text."
    },
    "OutputType": {
      "type": "string",
      "enum": [
        "binary",
        "categorical",
        "numerical",
        "date",
        "joint"
      ],
      "title": "OutputType",
      "description": "Question output type.\nValues:\n- binary: The outcome has two mutually exclusive possibilities, such as yes or no.\n- categorical: The outcome is one of several mutually exclusive named options.\n- numerical: The resolving outcome is a numeric value; include its unit and range.\n- date: The resolving outcome is a date or timestamp.\n- joint: The outcome is a vector of named numerical dimensions under one constraint."
    },
    "ResolutionCitations": {
      "properties": {
        "parts": {
          "items": {
            "$ref": "#/$defs/DecompositionTextPart"
          },
          "type": "array",
          "title": "Parts"
        },
        "sources": {
          "items": {
            "$ref": "#/$defs/DecompositionSource"
          },
          "type": "array",
          "title": "Sources"
        }
      },
      "type": "object",
      "required": [
        "parts",
        "sources"
      ],
      "title": "ResolutionCitations",
      "description": "The resolution agent's rationale split at its citations, each part naming the number of\nthe source it cites, and those sources in number order."
    },
    "ResolutionSourceResponse": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Publisher or vendor to credit, e.g. 'Trading Economics'."
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url",
          "description": "Link to the series the value was read from, where one is recorded."
        }
      },
      "type": "object",
      "required": [
        "label"
      ],
      "title": "ResolutionSourceResponse",
      "description": "Where a registry-resolved question's value was published."
    },
    "ScheduleEnum": {
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly",
        "release_backoff",
        "release_weekly",
        "one_time",
        "on_demand"
      ],
      "title": "ScheduleEnum"
    },
    "Ship2OutputMode": {
      "type": "string",
      "enum": [
        "universal",
        "specialised"
      ],
      "title": "Ship2OutputMode",
      "description": "Application output modes, retaining the existing API and database values."
    }
  }
}