{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fnlowl-com/json-schema/fnlowl-com-public-widget-schema.json",
  "title": "PublicWidget",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fnlowl-com-openapi.json#/components/schemas/PublicWidget",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "lead-magnet",
        "popup",
        "survey",
        "announcement-bar",
        "quiz",
        "calculator"
      ]
    },
    "headline": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "buttonText": {
      "type": "string"
    },
    "consentText": {
      "type": "string"
    },
    "termsUrl": {
      "type": "string"
    },
    "privacyUrl": {
      "type": "string"
    },
    "badge": {
      "type": "boolean"
    },
    "successHeadline": {
      "type": "string"
    },
    "successMessage": {
      "type": "string"
    },
    "layout": {
      "type": "string",
      "enum": [
        "simple",
        "visual"
      ]
    },
    "buttonStyle": {
      "type": "string",
      "enum": [
        "filled",
        "outline",
        "rounded"
      ]
    },
    "position": {
      "type": "string",
      "enum": [
        "intro",
        "middle",
        "end"
      ]
    },
    "requireEmail": {
      "type": "boolean"
    },
    "showOn": {
      "type": "string",
      "enum": [
        "all",
        "url"
      ]
    },
    "showOnValue": {
      "type": "string"
    },
    "hideOnValue": {
      "type": "string"
    },
    "accentColor": {
      "type": "string"
    },
    "theme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ]
    },
    "backgroundColor": {
      "type": "string"
    },
    "textColor": {
      "type": "string"
    },
    "cornerStyle": {
      "type": "string",
      "enum": [
        "sharp",
        "soft",
        "round"
      ]
    },
    "fontFamily": {
      "type": "string",
      "enum": [
        "system",
        "serif",
        "rounded",
        "mono"
      ]
    },
    "logoUrl": {
      "type": "string"
    },
    "placement": {
      "type": "string",
      "enum": [
        "center",
        "bottom-right",
        "bottom-left",
        "top-right",
        "top-left"
      ]
    },
    "popupWidth": {
      "type": "string",
      "enum": [
        "small",
        "medium",
        "large"
      ]
    },
    "floatingButton": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "bottom-left",
        "bottom-right",
        "left",
        "right"
      ]
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "immediate",
              "exit-intent",
              "scroll",
              "time",
              "click",
              "hover"
            ]
          },
          "value": {
            "type": "integer"
          },
          "selector": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "value",
          "selector"
        ]
      }
    },
    "triggerMode": {
      "type": "string",
      "enum": [
        "any",
        "all"
      ]
    },
    "audienceRules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "facet": {
            "type": "string",
            "enum": [
              "source",
              "device",
              "visitor"
            ]
          },
          "operator": {
            "type": "string",
            "enum": [
              "is",
              "is_not"
            ]
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "facet",
          "operator",
          "value"
        ]
      }
    },
    "cooldownDays": {
      "type": [
        "integer",
        "null"
      ]
    },
    "maxDismissals": {
      "type": [
        "integer",
        "null"
      ]
    },
    "firstStep": {
      "type": "string",
      "enum": [
        "none",
        "micro-commitment",
        "spin-to-win"
      ]
    },
    "hookQuestion": {
      "type": [
        "string",
        "null"
      ]
    },
    "barMessage": {
      "type": "string"
    },
    "barCtaText": {
      "type": "string"
    },
    "barCtaUrl": {
      "type": "string"
    },
    "barPosition": {
      "type": "string",
      "enum": [
        "top",
        "bottom",
        "top-left",
        "top-right",
        "bottom-left",
        "bottom-right"
      ]
    },
    "calcFormula": {
      "type": "string"
    },
    "calcOutputTemplate": {
      "type": "string"
    },
    "questions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "short",
              "long",
              "single",
              "multi"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "text",
          "type",
          "options"
        ]
      }
    },
    "quizQuestions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "score": {
                  "type": "integer"
                }
              },
              "required": [
                "label",
                "score"
              ]
            }
          }
        },
        "required": [
          "id",
          "text",
          "options"
        ]
      }
    },
    "quizTiers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "minScore": {
            "type": "integer"
          },
          "maxScore": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "minScore",
          "maxScore",
          "label",
          "message"
        ]
      }
    },
    "calcInputs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "min": {
            "type": "integer"
          },
          "max": {
            "type": "integer"
          },
          "step": {
            "type": "integer"
          },
          "default": {
            "type": "integer"
          }
        },
        "required": [
          "label",
          "min",
          "max",
          "step",
          "default"
        ]
      }
    },
    "wheelSegments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ]
      }
    },
    "questionRoutes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string"
          },
          "whenOption": {
            "type": "string"
          },
          "gotoQuestionId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "questionId",
          "whenOption",
          "gotoQuestionId"
        ]
      }
    }
  },
  "required": [
    "id",
    "kind",
    "headline",
    "description",
    "buttonText",
    "consentText",
    "termsUrl",
    "privacyUrl",
    "badge",
    "successHeadline",
    "successMessage",
    "layout",
    "buttonStyle",
    "position",
    "requireEmail",
    "showOn",
    "showOnValue",
    "hideOnValue",
    "accentColor",
    "theme",
    "backgroundColor",
    "textColor",
    "cornerStyle",
    "fontFamily",
    "logoUrl",
    "placement",
    "popupWidth",
    "floatingButton",
    "triggers",
    "triggerMode",
    "audienceRules",
    "cooldownDays",
    "maxDismissals",
    "firstStep",
    "hookQuestion",
    "barMessage",
    "barCtaText",
    "barCtaUrl",
    "barPosition",
    "calcFormula",
    "calcOutputTemplate",
    "questions",
    "quizQuestions",
    "quizTiers",
    "calcInputs",
    "wheelSegments",
    "questionRoutes"
  ]
}