{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/zelto/main/json-schema/zelto-experiment-create-schema.json",
  "title": "ExperimentCreate",
  "x-generated": "2026-10-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zelto-openapi.json#/components/schemas/ExperimentCreate",
  "type": "object",
  "required": [
    "name",
    "agentId",
    "armAVersionId",
    "armBVersionId",
    "outcomeMetricIds",
    "primaryMetricId",
    "stableRoutingConfirmed"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "agentId": {
      "type": "string",
      "format": "uuid"
    },
    "armAVersionId": {
      "type": "string",
      "format": "uuid"
    },
    "armBVersionId": {
      "type": "string",
      "format": "uuid"
    },
    "armAName": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 120
    },
    "armBName": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 120
    },
    "cohortFilters": {
      "type": "array",
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "assignmentUnit": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "const": "auto"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "kind",
            "key"
          ],
          "properties": {
            "kind": {
              "const": "metadata"
            },
            "key": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        }
      ]
    },
    "expectedArmAPercent": {
      "type": "integer",
      "minimum": 1,
      "maximum": 99,
      "default": 50
    },
    "outcomeMetricIds": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "primaryMetricId": {
      "type": "string",
      "format": "uuid"
    },
    "monitorGroupId": {
      "type": "string",
      "format": "uuid",
      "description": "Reuse a saved group from GET /v1/experiments/monitor-groups. outcomeMetricIds must match the group's current metricIds. Cannot be combined with newMonitorGroupName."
    },
    "newMonitorGroupName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Save outcomeMetricIds as a reusable organization group when launching. Cannot be combined with monitorGroupId."
    },
    "notifications": {
      "type": "object",
      "properties": {
        "emails": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      }
    },
    "stableRoutingConfirmed": {
      "const": true,
      "description": "Confirms that traffic is assigned consistently outside Zelto."
    }
  }
}