{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fnlowl-com/json-schema/fnlowl-com-widget-schema.json",
  "title": "Widget",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fnlowl-com-openapi.json#/components/schemas/Widget",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "type": "string",
      "enum": [
        "lead-magnet",
        "popup",
        "survey",
        "announcement-bar",
        "quiz",
        "calculator"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "static",
        "ai"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "live",
        "draft"
      ]
    },
    "article": {
      "type": "string"
    },
    "showOn": {
      "type": "string"
    },
    "showOnValue": {
      "type": "string"
    },
    "hideOnValue": {
      "type": "string"
    },
    "position": {
      "type": "string",
      "enum": [
        "intro",
        "middle",
        "end"
      ]
    },
    "headline": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "buttonText": {
      "type": "string"
    },
    "consentText": {
      "type": "string"
    },
    "successHeadline": {
      "type": "string"
    },
    "successMessage": {
      "type": "string"
    },
    "layout": {
      "type": "string",
      "enum": [
        "simple",
        "visual"
      ]
    },
    "theme": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "light",
        "dark"
      ]
    },
    "accentColor": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-fA-F]{3,8}$"
    },
    "backgroundColor": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-fA-F]{3,8}$"
    },
    "textColor": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9a-fA-F]{3,8}$"
    },
    "cornerStyle": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "sharp",
        "soft",
        "round"
      ]
    },
    "logoUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "placement": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "center",
        "bottom-right",
        "bottom-left",
        "top-right",
        "top-left"
      ]
    },
    "popupWidth": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "small",
        "medium",
        "large"
      ]
    },
    "floatingButton": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "bottom-left",
        "bottom-right",
        "left",
        "right"
      ]
    },
    "buttonStyle": {
      "type": "string",
      "enum": [
        "filled",
        "outline",
        "rounded"
      ]
    },
    "requireEmail": {
      "type": "boolean"
    },
    "contentUrl": {
      "type": "string"
    },
    "senderName": {
      "type": "string"
    },
    "subject": {
      "type": "string"
    },
    "emailBody": {
      "type": "string"
    },
    "emailFormat": {
      "type": "string",
      "enum": [
        "branded",
        "minimal"
      ]
    },
    "integrationId": {
      "type": [
        "string",
        "null"
      ]
    },
    "embedCode": {
      "type": "string"
    },
    "trackingOverride": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "pixelIds": {
          "type": "object",
          "properties": {
            "meta": {
              "type": "string"
            },
            "google": {
              "type": "string"
            },
            "tiktok": {
              "type": "string"
            },
            "linkedin": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "pixelIds"
      ]
    },
    "trigger": {
      "type": "string",
      "enum": [
        "immediate",
        "exit-intent",
        "scroll",
        "time"
      ]
    },
    "triggerValue": {
      "type": "integer"
    },
    "triggerMode": {
      "type": "string",
      "enum": [
        "any",
        "all"
      ]
    },
    "cooldownDays": {
      "type": [
        "integer",
        "null"
      ]
    },
    "maxDismissals": {
      "type": [
        "integer",
        "null"
      ]
    },
    "startAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "endAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "experimentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "trafficPct": {
      "type": [
        "integer",
        "null"
      ]
    },
    "rewardType": {
      "type": "string",
      "enum": [
        "none",
        "static",
        "unique"
      ]
    },
    "rewardCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "rewardPercent": {
      "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",
        "null"
      ],
      "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"
            }
          },
          "exits": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "text",
          "type",
          "options",
          "exits"
        ]
      }
    },
    "quizQuestions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "score": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "label",
                "score"
              ]
            }
          }
        },
        "required": [
          "id",
          "text",
          "options"
        ]
      }
    },
    "quizTiers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "minScore": {
            "type": "integer"
          },
          "maxScore": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "minScore",
          "maxScore",
          "label",
          "message"
        ]
      }
    },
    "calcInputs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "min": {
            "type": "integer"
          },
          "max": {
            "type": "integer"
          },
          "step": {
            "type": "integer"
          },
          "default": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "label",
          "min",
          "max",
          "step",
          "default"
        ]
      }
    },
    "wheelSegments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "rewardCode": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "rewardCode"
        ]
      }
    },
    "audienceRules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "facet": {
            "type": "string",
            "enum": [
              "source",
              "device",
              "visitor"
            ]
          },
          "operator": {
            "type": "string",
            "enum": [
              "is",
              "is_not"
            ]
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "facet",
          "operator",
          "value"
        ]
      }
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "immediate",
              "exit-intent",
              "scroll",
              "time",
              "click",
              "hover"
            ]
          },
          "value": {
            "type": "integer"
          },
          "selector": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "value",
          "selector"
        ]
      }
    },
    "questionRoutes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "questionId": {
            "type": "string"
          },
          "whenOption": {
            "type": "string"
          },
          "gotoQuestionId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "questionId",
          "whenOption",
          "gotoQuestionId"
        ]
      }
    },
    "completions": {
      "type": "integer"
    },
    "views": {
      "type": "integer"
    },
    "createdAt": {
      "type": "integer"
    },
    "updatedAt": {
      "type": "integer"
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "name",
    "kind",
    "type",
    "status",
    "article",
    "showOn",
    "showOnValue",
    "hideOnValue",
    "position",
    "headline",
    "description",
    "buttonText",
    "consentText",
    "successHeadline",
    "successMessage",
    "layout",
    "theme",
    "accentColor",
    "backgroundColor",
    "textColor",
    "cornerStyle",
    "logoUrl",
    "placement",
    "popupWidth",
    "floatingButton",
    "buttonStyle",
    "requireEmail",
    "contentUrl",
    "senderName",
    "subject",
    "emailBody",
    "emailFormat",
    "integrationId",
    "embedCode",
    "trackingOverride",
    "trigger",
    "triggerValue",
    "triggerMode",
    "cooldownDays",
    "maxDismissals",
    "startAt",
    "endAt",
    "experimentId",
    "trafficPct",
    "rewardType",
    "rewardCode",
    "rewardPercent",
    "firstStep",
    "hookQuestion",
    "barMessage",
    "barCtaText",
    "barCtaUrl",
    "barPosition",
    "calcFormula",
    "calcOutputTemplate",
    "questions",
    "quizQuestions",
    "quizTiers",
    "calcInputs",
    "wheelSegments",
    "audienceRules",
    "triggers",
    "questionRoutes",
    "completions",
    "views",
    "createdAt",
    "updatedAt",
    "issues"
  ]
}