{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/setluca-com/json-schema/setluca-com-campaign-generate-response-schema.json",
  "title": "CampaignGenerateResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/setluca-com-openapi-openapi.json#/components/schemas/CampaignGenerateResponse",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string",
      "minLength": 1
    },
    "graph": {
      "type": "object",
      "properties": {
        "version": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "startNodeId": {
          "type": "string",
          "minLength": 1
        },
        "nodes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "type": {
                "type": "string",
                "enum": [
                  "trigger",
                  "condition",
                  "action",
                  "message",
                  "booking",
                  "wait_duration",
                  "wait_until_time",
                  "wait_for_event",
                  "wait_for_reply",
                  "wait_for_condition",
                  "branch",
                  "control",
                  "stop",
                  "handoff",
                  "split",
                  "exit_on"
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "config": {
                "type": "object",
                "additionalProperties": {},
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          "minItems": 1,
          "maxItems": 100
        },
        "edges": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "source": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "target": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "condition": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "id",
              "source",
              "target"
            ]
          },
          "maxItems": 200,
          "default": []
        },
        "knowledge": {
          "type": "object",
          "properties": {
            "offerDescription": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "priceAndPaymentFacts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "programStructure": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "bookingRules": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "faqsAndObjections": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "disallowedClaims": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "resourceLinks": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              },
              "maxItems": 50
            },
            "exampleGoodReplies": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "sourceNotes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            }
          }
        },
        "qualification": {
          "type": "object",
          "properties": {
            "requiredFields": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "disqualifiers": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "maxItems": 50
            },
            "minimumScore": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "requireExplicitConsentBeforeBooking": {
              "type": "boolean"
            },
            "bookingCtaLogic": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            },
            "outcomes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "qualified",
                  "nurture",
                  "disqualified",
                  "needs_human"
                ]
              },
              "maxItems": 50
            }
          }
        },
        "analyticsGoal": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        }
      },
      "required": [
        "version",
        "startNodeId",
        "nodes"
      ]
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "alternativePlans": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "strategy": {
            "type": "string",
            "minLength": 1
          },
          "tradeoffs": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1
          },
          "recommended": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "strategy",
          "tradeoffs",
          "recommended"
        ]
      },
      "minItems": 3
    },
    "recommendedQuestions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "providerCapabilityAssumptions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "readinessChecklist": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "needs_review",
              "blocked"
            ]
          },
          "detail": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "label",
          "status",
          "detail"
        ]
      }
    },
    "seedCases": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "eventType": {
            "type": "string",
            "enum": [
              "instagram_comment",
              "instagram_dm",
              "whatsapp_reply",
              "booking_event",
              "crm_event",
              "webhook_event",
              "csv_import",
              "manual_enrollment"
            ]
          },
          "sourceKind": {
            "type": "string",
            "enum": [
              "fake_input",
              "seed_case",
              "replayed_enrollment"
            ]
          },
          "lead": {
            "type": "object",
            "additionalProperties": {}
          },
          "eventPayload": {
            "type": "object",
            "additionalProperties": {}
          },
          "context": {
            "type": "object",
            "additionalProperties": {}
          },
          "expectedOutcome": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name",
          "eventType",
          "sourceKind",
          "lead",
          "eventPayload",
          "context",
          "expectedOutcome"
        ]
      },
      "minItems": 5
    },
    "weakCopyFindings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "minLength": 1
          },
          "severity": {
            "type": "string",
            "enum": [
              "warning",
              "blocker"
            ]
          },
          "issue": {
            "type": "string",
            "minLength": 1
          },
          "suggestion": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "nodeId",
          "severity",
          "issue",
          "suggestion"
        ]
      }
    },
    "publishGate": {
      "type": "object",
      "properties": {
        "simulatorPassRequired": {
          "type": "boolean"
        },
        "requiredSeedCaseCount": {
          "type": "integer",
          "minimum": 1
        },
        "requiredPassingSeedCases": {
          "type": "integer",
          "minimum": 1
        },
        "blocksPublishUntil": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "detail": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "simulatorPassRequired",
        "requiredSeedCaseCount",
        "requiredPassingSeedCases",
        "blocksPublishUntil",
        "detail"
      ]
    },
    "repairLog": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "safety": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "allow",
            "review",
            "block"
          ]
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reviewReasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "review",
                  "block"
                ]
              },
              "message": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "nodeId": {
                "type": "string"
              },
              "confidence": {
                "type": "number"
              },
              "evidence": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "action",
              "message",
              "source"
            ]
          }
        }
      },
      "required": [
        "action",
        "blockers",
        "reviewReasons",
        "findings"
      ]
    }
  },
  "required": [
    "name",
    "description",
    "graph",
    "assumptions",
    "alternativePlans",
    "recommendedQuestions",
    "providerCapabilityAssumptions",
    "readinessChecklist",
    "seedCases",
    "weakCopyFindings",
    "publishGate",
    "repairLog",
    "safety"
  ]
}