{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mandiant/json-schema/mandiant-builder-report-wrapped-schema.json",
  "title": "builder_report_wrapped",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/mandiant-report-builder-api-openapi.yml#/components/schemas/builder_report_wrapped",
  "type": "object",
  "properties": {
    "builder_report": {
      "$ref": "#/$defs/builder_report"
    }
  },
  "$defs": {
    "builder_report": {
      "type": "object",
      "required": [
        "name",
        "time_range"
      ],
      "properties": {
        "name": {
          "description": "Name of the report",
          "type": "string"
        },
        "time_range": {
          "$ref": "#/$defs/time_range"
        },
        "filter_rules": {
          "$ref": "#/$defs/filter_rules"
        },
        "report_panels_attributes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "description": "Order of the panels",
                "type": "integer"
              },
              "panel_id": {
                "description": "ID of the UI panel to use (Stat, Bar chart, etc.)",
                "type": "integer"
              },
              "config": {
                "description": "Config for the UI panel. Varies between panels",
                "type": "object"
              },
              "time_range": {
                "$ref": "#/$defs/time_range"
              },
              "filter_rules": {
                "$ref": "#/$defs/filter_rules"
              },
              "children_attributes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "order": {
                      "type": "integer"
                    },
                    "panel_id": {
                      "type": "integer"
                    },
                    "config": {
                      "type": "object"
                    },
                    "time_range": {
                      "$ref": "#/$defs/time_range"
                    },
                    "filter_rules": {
                      "$ref": "#/$defs/filter_rules"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "filter_rules": {
      "description": "Filter rules to use for the data source",
      "type": "object",
      "properties": {
        "operator": {
          "description": "How to combine multiple rules",
          "type": "string",
          "enum": [
            "or",
            "and"
          ]
        },
        "conditions": {
          "description": "Conditions of the rule",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "operator": {
                "type": "string",
                "enum": [
                  "or",
                  "and"
                ]
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "operator": {
                      "type": "string",
                      "enum": [
                        "in",
                        "not in"
                      ]
                    },
                    "match_object": {
                      "type": "string",
                      "enum": [
                        "action",
                        "job",
                        "evaluation",
                        "sequence",
                        "monitor",
                        "threat_actor",
                        "source_actor",
                        "destination_actor",
                        "actor",
                        "source_zone",
                        "destination_zone",
                        "zone"
                      ]
                    },
                    "match_field": {
                      "type": "string",
                      "enum": [
                        "tags",
                        "results",
                        "action_type",
                        "mitre_tactic",
                        "dimensions.stage_of_attack",
                        "dimensions.attack_behavior",
                        "dimensions.os_platform",
                        "controls"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "time_range": {
      "description": "Time range to use for the data source",
      "type": "object",
      "required": [
        "rangeType"
      ],
      "properties": {
        "end": {
          "description": "End date. Only required if `rangeType` is \"abs\" (absolute)",
          "type": "string"
        },
        "rangeType": {
          "description": "Describes if the time range is relative or absolute. Only required if `rangeType` is \"rel\"",
          "type": "string",
          "enum": [
            "rel",
            "abs"
          ]
        },
        "relBackCount": {
          "description": "Amount of `relUnit` to go backwards",
          "type": "integer"
        },
        "relUnit": {
          "description": "Unit to use for relative time ranges. Only required if `rangeType` is \"rel\"",
          "type": "string",
          "enum": [
            "minute",
            "hour",
            "day",
            "week",
            "month",
            "year"
          ]
        },
        "start": {
          "description": "Start date. Only required if `rangeType` is \"abs\"",
          "type": "string"
        }
      }
    }
  }
}