{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/superflag-sh/json-schema/superflag-sh-experiment-baseline-create-request-schema.json",
  "title": "ExperimentBaselineCreateRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/superflag-sh-openapi.json#/components/schemas/ExperimentBaselineCreateRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "appId",
    "env",
    "metric",
    "baseline",
    "sampleSize",
    "source",
    "idempotencyKey"
  ],
  "properties": {
    "appId": {
      "type": "string"
    },
    "env": {
      "type": "string"
    },
    "metric": {
      "$ref": "#/$defs/MetricRevisionReference"
    },
    "baseline": {
      "type": "object"
    },
    "sampleSize": {
      "type": "integer",
      "minimum": 0
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "manual",
            "historical_aggregate"
          ]
        },
        "note": {
          "type": "string"
        }
      }
    },
    "window": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "startedAt",
        "endedAt"
      ],
      "properties": {
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "endedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "observedThrough": {
      "type": "string",
      "format": "date-time"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 16,
      "maxLength": 128
    }
  },
  "$defs": {
    "MetricRevisionReference": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "key",
        "revision"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        }
      }
    }
  }
}