{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/uservane-com/json-schema/uservane-com-bootstrap-response-schema.json",
  "title": "BootstrapResponse",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/uservane-com-openapi.yaml#/components/schemas/BootstrapResponse",
  "type": "object",
  "required": [
    "surveys",
    "suppression"
  ],
  "properties": {
    "surveys": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SurveyDefinition"
      }
    },
    "suppression": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Survey ids this respondent has answered or dismissed"
    },
    "showTokens": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "surveyId -> single-use show-token; missing means gated"
    }
  },
  "$defs": {
    "SurveyDefinition": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "type",
        "question",
        "presentation",
        "trigger"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "nps",
            "csat",
            "ces",
            "pmf"
          ]
        },
        "question": {
          "type": "string"
        },
        "followUpQuestion": {
          "type": "string"
        },
        "presentation": {
          "type": "string",
          "enum": [
            "corner",
            "inline",
            "banner"
          ]
        },
        "corner": {
          "type": "string",
          "enum": [
            "bottom-right",
            "bottom-left",
            "top-right",
            "top-left"
          ]
        },
        "trigger": {
          "type": "string",
          "enum": [
            "auto",
            "manual"
          ]
        },
        "delayMs": {
          "type": "number"
        },
        "samplePercent": {
          "type": "number"
        },
        "targeting": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "trait",
              "op"
            ],
            "properties": {
              "trait": {
                "type": "string"
              },
              "op": {
                "type": "string",
                "enum": [
                  "eq",
                  "neq",
                  "in",
                  "gt",
                  "lt",
                  "gte",
                  "lte",
                  "exists"
                ]
              },
              "value": {}
            }
          }
        },
        "showBadge": {
          "type": "boolean"
        },
        "endLabels": {
          "type": "object",
          "properties": {
            "low": {
              "type": "string"
            },
            "high": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}