{
  "$id": "https://betterstood.com/developers/v14/schemas/mcp/scenario_export.output.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "additionalProperties": false,
      "properties": {
        "exportedAt": {
          "format": "date-time",
          "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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "type": "string"
        },
        "format": {
          "const": "elicitra.scenario.v1",
          "type": "string"
        },
        "scenario": {
          "additionalProperties": false,
          "properties": {
            "definition": {
              "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"
                },
                "assistantName": {
                  "description": "Optional assistant identity label. Betterstood keeps AI identity and actual recording/transcription wording server-owned.",
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "audience": {
                  "maxLength": 8192,
                  "minLength": 1,
                  "type": "string"
                },
                "conversation": {
                  "additionalProperties": false,
                  "properties": {
                    "instructions": {
                      "default": [],
                      "items": {
                        "maxLength": 400,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 12,
                      "type": "array"
                    },
                    "openingQuestion": {
                      "maxLength": 8192,
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "required": [
                    "instructions"
                  ],
                  "type": "object"
                },
                "fields": {
                  "items": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "collection": {
                            "additionalProperties": false,
                            "properties": {
                              "form": {
                                "additionalProperties": false,
                                "properties": {
                                  "help_text": {
                                    "maxLength": 240,
                                    "type": "string"
                                  },
                                  "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",
                          "followupGuidance",
                          "goodAnswerExamples",
                          "weakAnswerExamples",
                          "type"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "collection": {
                            "additionalProperties": false,
                            "properties": {
                              "form": {
                                "additionalProperties": false,
                                "properties": {
                                  "help_text": {
                                    "maxLength": 240,
                                    "type": "string"
                                  },
                                  "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",
                          "followupGuidance",
                          "goodAnswerExamples",
                          "weakAnswerExamples",
                          "type",
                          "options",
                          "collection"
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  "maxItems": 100,
                  "minItems": 1,
                  "type": "array"
                },
                "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"
                },
                "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"
                },
                "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"
                },
                "purpose": {
                  "maxLength": 8192,
                  "minLength": 1,
                  "type": "string"
                },
                "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"
                },
                "tone": {
                  "maxLength": 8192,
                  "minLength": 1,
                  "type": "string"
                }
              },
              "required": [
                "purpose"
              ],
              "type": "object"
            },
            "language": {
              "enum": [
                "it-IT",
                "en-US",
                "es-ES",
                "fr-FR",
                "de-DE",
                "hi-IN",
                "ru-RU",
                "pt-PT",
                "ja-JP",
                "nl-NL"
              ],
              "type": "string"
            },
            "mcpEditability": {
              "additionalProperties": false,
              "properties": {
                "activeCampaignCount": {
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "type": "integer"
                },
                "editable": {
                  "type": "boolean"
                },
                "reason": {
                  "enum": [
                    "draft",
                    "active_campaign"
                  ],
                  "type": "string"
                },
                "studioUrl": {
                  "maxLength": 2048,
                  "type": "string"
                }
              },
              "required": [
                "editable",
                "reason",
                "activeCampaignCount",
                "studioUrl"
              ],
              "type": "object"
            },
            "name": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            "revision": {
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991,
              "type": "integer"
            },
            "scenarioId": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "slug": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "updatedAt": {
              "format": "date-time",
              "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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
              "type": "string"
            }
          },
          "required": [
            "scenarioId",
            "slug",
            "name",
            "language",
            "revision",
            "updatedAt",
            "mcpEditability",
            "definition"
          ],
          "type": "object"
        }
      },
      "required": [
        "format",
        "exportedAt",
        "scenario"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "NOT_FOUND",
            "REVISION_CONFLICT",
            "RESOURCE_LOCKED",
            "SCENARIO_LOCKED",
            "CAMPAIGN_LOCKED",
            "VALIDATION_FAILED",
            "QUOTA_EXCEEDED",
            "TOOL_NOT_AVAILABLE",
            "IDEMPOTENCY_KEY_REUSED",
            "REMOVAL_ACKNOWLEDGEMENT_REQUIRED",
            "UNAUTHORIZED",
            "FORBIDDEN",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE"
          ],
          "type": "string"
        },
        "currentRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "docsUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "editorUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "expectedRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "field": {
          "maxLength": 256,
          "type": "string"
        },
        "issues": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "maxLength": 128,
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "maxItems": 100,
          "type": "array"
        },
        "message": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "studioUrl": {
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "type": "object"
    }
  ],
  "title": "scenario_export output",
  "type": "object"
}
