{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/forge/json-schema/forge-headless-policy-backtest-request-schema.json",
  "title": "HeadlessPolicyBacktestRequest",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/forge-openapi.yaml#/components/schemas/HeadlessPolicyBacktestRequest",
  "allOf": [
    {
      "$ref": "#/$defs/HeadlessSafetyFields"
    },
    {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "auto",
            "quick",
            "full"
          ]
        },
        "policyId": {
          "type": "string"
        },
        "family": {
          "type": "string",
          "enum": [
            "content",
            "access",
            "resource"
          ]
        },
        "definition": {
          "type": "object",
          "additionalProperties": true
        },
        "name": {
          "type": "string"
        },
        "filters": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "since": {
              "type": "string",
              "format": "date-time"
            },
            "until": {
              "type": "string",
              "format": "date-time"
            },
            "integrationIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "directoryUserIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "deviceIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "sessionIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "eventKinds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "toolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "modelNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "HeadlessSafetyFields": {
      "type": "object",
      "required": [
        "reason",
        "idempotencyKey",
        "confirm"
      ],
      "properties": {
        "reason": {
          "type": "string"
        },
        "idempotencyKey": {
          "type": "string"
        },
        "dryRun": {
          "type": "boolean"
        },
        "confirm": {
          "type": "boolean"
        }
      }
    }
  }
}