{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/inforcer/json-schema/inforcer-trigger-report-request-schema.json",
  "title": "triggerReportRequest",
  "description": "Body for queueing a report run",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/inforcer-openapi.json#/components/schemas/triggerReportRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "reports",
    "tenants"
  ],
  "properties": {
    "reports": {
      "type": "array",
      "description": "One or more reports to generate as part of this run",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/triggerReportItem"
      }
    },
    "tenants": {
      "$ref": "#/$defs/triggerReportTenants"
    }
  },
  "$defs": {
    "triggerReportItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "outputFormat"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The report type key, matching `reportType.key` from the `getReportTypes` operation (e.g. copilotadoption, activeusercount)."
        },
        "outputFormat": {
          "type": "string",
          "description": "Output format for this report item",
          "enum": [
            "pdf",
            "csv",
            "html",
            "json"
          ]
        },
        "collate": {
          "type": "boolean",
          "default": false,
          "description": "When true, combine outputs across all tenants into a single document"
        },
        "parameters": {
          "type": "object",
          "description": "Optional key/value parameters specific to the report type",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "triggerReportTenants": {
      "type": "object",
      "description": "Tenant scope for the report run",
      "additionalProperties": false,
      "required": [
        "includeTenants"
      ],
      "properties": {
        "includeTenants": {
          "type": "array",
          "description": "Tenant IDs the run should cover. Must be a non-empty subset of the\ntenants the calling API key has access to.\n",
          "minItems": 1,
          "items": {
            "type": "integer"
          }
        }
      }
    }
  }
}