{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/produktly-com/json-schema/produktly-com-product-tour-schema.json",
  "title": "ProductTour",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/produktly-com-api-openapi.json#/components/schemas/ProductTour",
  "allOf": [
    {
      "$ref": "#/$defs/ProductTourSummary"
    },
    {
      "type": "object",
      "properties": {
        "themeId": {
          "type": [
            "integer",
            "null"
          ]
        },
        "steps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductTourStep"
          }
        },
        "settings": {
          "$ref": "#/$defs/ProductTourSettings"
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TargetingRule"
          }
        },
        "ruleLogicalOperator": {
          "type": [
            "string",
            "null"
          ]
        },
        "dashboardUrl": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "themeId",
        "steps",
        "settings",
        "rules",
        "ruleLogicalOperator",
        "dashboardUrl"
      ]
    }
  ],
  "$defs": {
    "ProductTourSettings": {
      "type": "object",
      "properties": {
        "tourStart": {
          "type": "string",
          "enum": [
            "minified",
            "immediate-minified",
            "immediate",
            "manually"
          ],
          "description": "How the tour starts. Default \"minified\" (beacon). \"manually\" = only via Produktly.startTour()"
        },
        "startDelay": {
          "type": "number",
          "minimum": 0,
          "description": "Seconds before start. Default 0"
        },
        "trigger": {
          "type": "string",
          "enum": [
            "once",
            "always"
          ],
          "description": "Default \"once\""
        },
        "saveProgress": {
          "type": "boolean",
          "description": "Resume where the user left off. Default true"
        },
        "hideBeacon": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": [
                "yes",
                "no"
              ]
            }
          ],
          "description": "Only meaningful with tourStart \"manually\". Default no"
        },
        "beaconPosition": {
          "type": "string",
          "enum": [
            "bottom-right",
            "bottom-left"
          ]
        },
        "multiPageEnabled": {
          "type": "boolean",
          "description": "Continue the tour across page loads. Default true"
        },
        "timeout": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Seconds to wait for a step's element. Default 5"
        },
        "allowClosingTour": {
          "type": "boolean",
          "description": "Show the X / allow Escape. Default true"
        },
        "closeOnOutsideClick": {
          "type": "boolean",
          "description": "Default false"
        },
        "themeColor": {
          "type": "string",
          "description": "CSS color. Overridden by an attached theme"
        },
        "textColor": {
          "type": "string"
        },
        "nextBtnText": {
          "type": "string"
        },
        "backBtnText": {
          "type": "string"
        },
        "finishBtnText": {
          "type": "string"
        },
        "startTourBtnText": {
          "type": "string",
          "description": "Beacon label. Default \"Start Product Tour\""
        },
        "continueTourBtnText": {
          "type": "string",
          "description": "Default \"Continue Tour\""
        },
        "filterType": {
          "type": "string",
          "description": "Derived from targeting. \"everywhere\" when the tour shows on all pages"
        }
      },
      "description": "Stored settings: everything accepted on create or update, plus server-managed keys such as filterType and, for tours built in the dashboard, localisation fields."
    },
    "ProductTourStep": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "highlight",
            "modal",
            "static",
            "welcome",
            "toast",
            "redirect"
          ]
        },
        "id": {
          "type": "string",
          "description": "Assigned by Produktly when the step is stored"
        }
      },
      "required": [
        "type"
      ],
      "description": "A stored tour step. Fields vary by type; see the create or update request body for each type's full shape."
    },
    "ProductTourSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "folderId": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "active",
        "createdAt",
        "updatedAt",
        "folderId"
      ]
    },
    "TargetingRule": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Rule type, \"user_segment\" for segment rules, or \"custom::::<attributeKey>\" for a user attribute"
        },
        "comparisonOperator": {
          "type": "string"
        },
        "value": {},
        "userSegmentId": {
          "type": "integer",
          "description": "Present on \"user_segment\" rules"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}