{
  "$id": "https://betterstood.com/developers/v31/schemas/mcp/scenario_update_draft.input.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "expectedRevision": {
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "type": "integer"
    },
    "idempotencyKey": {
      "maxLength": 128,
      "minLength": 8,
      "type": "string"
    },
    "operations": {
      "items": {
        "anyOf": [
          {
            "additionalProperties": false,
            "properties": {
              "policy": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "additionalProperties": false,
                    "properties": {
                      "textChat": {
                        "type": "boolean"
                      },
                      "voice": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "voice",
                      "textChat"
                    ],
                    "type": "object"
                  },
                  "disclaimer": {
                    "additionalProperties": false,
                    "properties": {
                      "delivery": {
                        "enum": [
                          "conversation_and_intake",
                          "intake_only"
                        ],
                        "type": "string"
                      },
                      "enabled": {
                        "const": true,
                        "type": "boolean"
                      },
                      "text": {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      }
                    },
                    "required": [
                      "enabled",
                      "text",
                      "delivery"
                    ],
                    "type": "object"
                  },
                  "extractionGuidance": {
                    "items": {
                      "maxLength": 400,
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 12,
                    "type": "array"
                  },
                  "maxFollowupsPerQuestion": {
                    "maximum": 5,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "media": {
                    "additionalProperties": false,
                    "properties": {
                      "dictation": {
                        "type": "boolean"
                      },
                      "images": {
                        "type": "boolean"
                      },
                      "video": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "images",
                      "video",
                      "dictation"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "channels",
                  "maxFollowupsPerQuestion",
                  "disclaimer",
                  "extractionGuidance"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_policy",
                "type": "string"
              }
            },
            "required": [
              "type",
              "policy"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "rules": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "action": {
                      "oneOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "message": {
                              "maxLength": 2000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "subject": {
                              "maxLength": 160,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "send_email",
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "subject",
                            "message"
                          ],
                          "type": "object"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "message": {
                              "maxLength": 2000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "recipient": {
                              "oneOf": [
                                {
                                  "additionalProperties": false,
                                  "properties": {
                                    "kind": {
                                      "const": "workspace_default",
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "additionalProperties": false,
                                  "properties": {
                                    "kind": {
                                      "const": "organization_member",
                                      "type": "string"
                                    },
                                    "userId": {
                                      "maxLength": 256,
                                      "minLength": 1,
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "userId"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "additionalProperties": false,
                                  "properties": {
                                    "email": {
                                      "format": "email",
                                      "maxLength": 254,
                                      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                                      "type": "string"
                                    },
                                    "kind": {
                                      "const": "custom_email",
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "email"
                                  ],
                                  "type": "object"
                                }
                              ]
                            },
                            "subject": {
                              "maxLength": 160,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "notify_operator_email",
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "subject",
                            "message"
                          ],
                          "type": "object"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "message": {
                              "maxLength": 2000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "subject": {
                              "maxLength": 160,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "notify_operator_slack",
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "subject",
                            "message"
                          ],
                          "type": "object"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "destinationId": {
                              "maxLength": 256,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "trigger_automation_webhook",
                              "type": "string"
                            }
                          },
                          "required": [
                            "type",
                            "destinationId"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "conditions": {
                      "items": {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "properties": {
                              "field": {
                                "enum": [
                                  "intent",
                                  "completeness"
                                ],
                                "type": "string"
                              },
                              "operator": {
                                "enum": [
                                  "gte",
                                  "lte",
                                  "equals"
                                ],
                                "type": "string"
                              },
                              "source": {
                                "const": "score",
                                "type": "string"
                              },
                              "value": {
                                "maximum": 5,
                                "minimum": 1,
                                "type": "integer"
                              }
                            },
                            "required": [
                              "source",
                              "field",
                              "operator",
                              "value"
                            ],
                            "type": "object"
                          },
                          {
                            "additionalProperties": false,
                            "properties": {
                              "field": {
                                "pattern": "^[a-z][a-z0-9_]{1,63}$",
                                "type": "string"
                              },
                              "operator": {
                                "enum": [
                                  "equals",
                                  "not_equals"
                                ],
                                "type": "string"
                              },
                              "source": {
                                "const": "classification",
                                "type": "string"
                              },
                              "value": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              }
                            },
                            "required": [
                              "source",
                              "field",
                              "operator",
                              "value"
                            ],
                            "type": "object"
                          }
                        ]
                      },
                      "maxItems": 8,
                      "type": "array"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "id": {
                      "maxLength": 100,
                      "minLength": 1,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 100,
                      "minLength": 1,
                      "type": "string"
                    },
                    "match": {
                      "enum": [
                        "all",
                        "any"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "enabled",
                    "match",
                    "conditions",
                    "action"
                  ],
                  "type": "object"
                },
                "maxItems": 20,
                "type": "array"
              },
              "type": {
                "const": "set_rules",
                "type": "string"
              }
            },
            "required": [
              "type",
              "rules"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "profile": {
                "additionalProperties": false,
                "properties": {
                  "audience": {
                    "anyOf": [
                      {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "purpose": {
                    "maxLength": 8192,
                    "minLength": 1,
                    "type": "string"
                  },
                  "tone": {
                    "anyOf": [
                      {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "purpose"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_profile",
                "type": "string"
              }
            },
            "required": [
              "type",
              "profile"
            ],
            "type": "object"
          },
          {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "assistantName": {
                    "anyOf": [
                      {
                        "description": "Optional assistant identity label. Betterstood keeps AI identity and actual recording/transcription wording server-owned.",
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "language": {
                    "enum": [
                      "it-IT",
                      "en-US",
                      "es-ES",
                      "fr-FR",
                      "de-DE",
                      "hi-IN",
                      "ru-RU",
                      "pt-PT",
                      "ja-JP",
                      "nl-NL"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": {
                    "const": "set_metadata",
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "name"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "assistantName": {
                    "anyOf": [
                      {
                        "description": "Optional assistant identity label. Betterstood keeps AI identity and actual recording/transcription wording server-owned.",
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "language": {
                    "enum": [
                      "it-IT",
                      "en-US",
                      "es-ES",
                      "fr-FR",
                      "de-DE",
                      "hi-IN",
                      "ru-RU",
                      "pt-PT",
                      "ja-JP",
                      "nl-NL"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": {
                    "const": "set_metadata",
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "language"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "assistantName": {
                    "anyOf": [
                      {
                        "description": "Optional assistant identity label. Betterstood keeps AI identity and actual recording/transcription wording server-owned.",
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "language": {
                    "enum": [
                      "it-IT",
                      "en-US",
                      "es-ES",
                      "fr-FR",
                      "de-DE",
                      "hi-IN",
                      "ru-RU",
                      "pt-PT",
                      "ja-JP",
                      "nl-NL"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": {
                    "const": "set_metadata",
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "assistantName"
                ],
                "type": "object"
              }
            ]
          },
          {
            "additionalProperties": false,
            "properties": {
              "intake": {
                "additionalProperties": false,
                "properties": {
                  "ctaLabel": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "headline": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "subheadline": {
                    "maxLength": 8192,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "headline",
                  "subheadline",
                  "ctaLabel"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_intake",
                "type": "string"
              }
            },
            "required": [
              "type",
              "intake"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "conversation": {
                "additionalProperties": false,
                "properties": {
                  "instructions": {
                    "items": {
                      "maxLength": 400,
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 12,
                    "type": "array"
                  },
                  "openingQuestion": {
                    "anyOf": [
                      {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              "type": {
                "const": "set_conversation",
                "type": "string"
              }
            },
            "required": [
              "type",
              "conversation"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "field": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "collection": {
                        "additionalProperties": false,
                        "properties": {
                          "form": {
                            "additionalProperties": false,
                            "properties": {
                              "max_date": {
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                "type": "string"
                              },
                              "max_number": {
                                "type": "number"
                              },
                              "min_date": {
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                "type": "string"
                              },
                              "min_number": {
                                "type": "number"
                              },
                              "number_step": {
                                "exclusiveMinimum": 0,
                                "type": "number"
                              }
                            },
                            "type": "object"
                          },
                          "mode": {
                            "enum": [
                              "conversation",
                              "form"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "mode"
                        ],
                        "type": "object"
                      },
                      "followupGuidance": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      },
                      "goodAnswerExamples": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      },
                      "key": {
                        "pattern": "^[a-z][a-z0-9_]{1,63}$",
                        "type": "string"
                      },
                      "label": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "options": {
                        "anyOf": [
                          {
                            "items": {
                              "maxLength": 256,
                              "minLength": 1,
                              "type": "string"
                            },
                            "maxItems": 100,
                            "type": "array"
                          },
                          {
                            "items": {
                              "additionalProperties": false,
                              "properties": {
                                "label": {
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "value": {
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "type": "string"
                                }
                              },
                              "required": [
                                "value",
                                "label"
                              ],
                              "type": "object"
                            },
                            "maxItems": 100,
                            "type": "array"
                          }
                        ]
                      },
                      "primaryQuestion": {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "stopCondition": {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "text",
                          "number",
                          "currency",
                          "boolean",
                          "select",
                          "date",
                          "email",
                          "phone"
                        ],
                        "type": "string"
                      },
                      "weakAnswerExamples": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      }
                    },
                    "required": [
                      "key",
                      "label",
                      "required",
                      "primaryQuestion",
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "collection": {
                        "additionalProperties": false,
                        "properties": {
                          "form": {
                            "additionalProperties": false,
                            "properties": {
                              "max_date": {
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                "type": "string"
                              },
                              "max_number": {
                                "type": "number"
                              },
                              "min_date": {
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                "type": "string"
                              },
                              "min_number": {
                                "type": "number"
                              },
                              "number_step": {
                                "exclusiveMinimum": 0,
                                "type": "number"
                              }
                            },
                            "type": "object"
                          },
                          "mode": {
                            "const": "form",
                            "type": "string"
                          }
                        },
                        "required": [
                          "mode"
                        ],
                        "type": "object"
                      },
                      "followupGuidance": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      },
                      "goodAnswerExamples": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      },
                      "key": {
                        "pattern": "^[a-z][a-z0-9_]{1,63}$",
                        "type": "string"
                      },
                      "label": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "options": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "label": {
                              "maxLength": 256,
                              "minLength": 1,
                              "type": "string"
                            },
                            "value": {
                              "maxLength": 256,
                              "minLength": 1,
                              "type": "string"
                            }
                          },
                          "required": [
                            "value",
                            "label"
                          ],
                          "type": "object"
                        },
                        "maxItems": 20,
                        "minItems": 2,
                        "type": "array"
                      },
                      "primaryQuestion": {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "stopCondition": {
                        "maxLength": 8192,
                        "minLength": 1,
                        "type": "string"
                      },
                      "type": {
                        "const": "multi_select",
                        "type": "string"
                      },
                      "weakAnswerExamples": {
                        "default": [],
                        "items": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 20,
                        "type": "array"
                      }
                    },
                    "required": [
                      "key",
                      "label",
                      "required",
                      "primaryQuestion",
                      "type",
                      "options",
                      "collection"
                    ],
                    "type": "object"
                  }
                ]
              },
              "type": {
                "const": "upsert_field",
                "type": "string"
              }
            },
            "required": [
              "type",
              "field"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "key": {
                "pattern": "^[a-z][a-z0-9_]{1,63}$",
                "type": "string"
              },
              "type": {
                "const": "remove_field",
                "type": "string"
              }
            },
            "required": [
              "type",
              "key",
              "confirmRemovals"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "fieldKeys": {
                "items": {
                  "pattern": "^[a-z][a-z0-9_]{1,63}$",
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "type": {
                "const": "reorder_fields",
                "type": "string"
              }
            },
            "required": [
              "type",
              "fieldKeys"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "outputs": {
                "additionalProperties": false,
                "properties": {
                  "handoffLabel": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "requiredSections": {
                    "items": {
                      "maxLength": 256,
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "summaryLabel": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "summaryLabel",
                  "handoffLabel",
                  "requiredSections"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_outputs",
                "type": "string"
              }
            },
            "required": [
              "type",
              "outputs"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "scoring": {
                "additionalProperties": false,
                "properties": {
                  "completenessEnabled": {
                    "type": "boolean"
                  },
                  "completenessLabel": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "completenessThreshold": {
                    "maximum": 5,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "intentEnabled": {
                    "type": "boolean"
                  },
                  "intentLabel": {
                    "maxLength": 256,
                    "minLength": 1,
                    "type": "string"
                  },
                  "intentThreshold": {
                    "maximum": 5,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "qualificationMatch": {
                    "enum": [
                      "all",
                      "any"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "intentEnabled",
                  "intentLabel",
                  "completenessEnabled",
                  "completenessLabel",
                  "qualificationMatch",
                  "intentThreshold",
                  "completenessThreshold"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_scoring",
                "type": "string"
              }
            },
            "required": [
              "type",
              "scoring"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "analysis": {
                "additionalProperties": false,
                "properties": {
                  "analysisQuestions": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "pattern": "^[a-z][a-z0-9_]{1,63}$",
                          "type": "string"
                        },
                        "question": {
                          "maxLength": 8192,
                          "minLength": 1,
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "question"
                      ],
                      "type": "object"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "classificationAxes": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "pattern": "^[a-z][a-z0-9_]{1,63}$",
                          "type": "string"
                        },
                        "label": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "values": {
                          "items": {
                            "maxLength": 256,
                            "minLength": 1,
                            "type": "string"
                          },
                          "maxItems": 12,
                          "minItems": 1,
                          "type": "array"
                        }
                      },
                      "required": [
                        "key",
                        "label",
                        "values"
                      ],
                      "type": "object"
                    },
                    "maxItems": 12,
                    "type": "array"
                  },
                  "style": {
                    "enum": [
                      "lead_qualification",
                      "qualitative_research",
                      "diagnostic_intake",
                      "hybrid"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "type": {
                "const": "set_analysis",
                "type": "string"
              }
            },
            "required": [
              "type",
              "analysis"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "confirmRemovals": {
                "const": true,
                "type": "boolean"
              },
              "liveFit": {
                "additionalProperties": false,
                "properties": {
                  "gates": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "askEarly": {
                          "type": "boolean"
                        },
                        "closingMessage": {
                          "maxLength": 1000,
                          "minLength": 1,
                          "type": "string"
                        },
                        "comparisonMode": {
                          "enum": [
                            "exact",
                            "semantic"
                          ],
                          "type": "string"
                        },
                        "confirmation": {
                          "enum": [
                            "only_if_ambiguous",
                            "required_on_mismatch"
                          ],
                          "type": "string"
                        },
                        "description": {
                          "maxLength": 500,
                          "type": "string"
                        },
                        "fieldKey": {
                          "pattern": "^[a-z][a-z0-9_]{1,63}$",
                          "type": "string"
                        },
                        "id": {
                          "pattern": "^[a-z][a-z0-9_]{1,63}$",
                          "type": "string"
                        },
                        "label": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxClarifications": {
                          "anyOf": [
                            {
                              "const": 0,
                              "type": "number"
                            },
                            {
                              "const": 1,
                              "type": "number"
                            }
                          ]
                        },
                        "operator": {
                          "enum": [
                            "equals",
                            "not_equals",
                            "in",
                            "not_in"
                          ],
                          "type": "string"
                        },
                        "preansweredMismatch": {
                          "enum": [
                            "block_before_start",
                            "confirm_live"
                          ],
                          "type": "string"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "values": {
                          "items": {
                            "anyOf": [
                              {
                                "maxLength": 1000,
                                "minLength": 1,
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              }
                            ]
                          },
                          "maxItems": 100,
                          "minItems": 1,
                          "type": "array"
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "fieldKey",
                        "operator",
                        "values",
                        "comparisonMode",
                        "askEarly",
                        "required",
                        "confirmation",
                        "maxClarifications",
                        "preansweredMismatch",
                        "closingMessage"
                      ],
                      "type": "object"
                    },
                    "maxItems": 10,
                    "type": "array"
                  },
                  "schemaVersion": {
                    "const": "live-fit.v1",
                    "type": "string"
                  }
                },
                "required": [
                  "schemaVersion",
                  "gates"
                ],
                "type": "object"
              },
              "type": {
                "const": "set_live_fit",
                "type": "string"
              }
            },
            "required": [
              "type",
              "liveFit"
            ],
            "type": "object"
          }
        ]
      },
      "maxItems": 100,
      "minItems": 1,
      "type": "array"
    },
    "scenarioId": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "idempotencyKey",
    "scenarioId",
    "expectedRevision",
    "operations"
  ],
  "title": "scenario_update_draft input",
  "type": "object"
}
