{
  "openapi": "3.1.0",
  "info": {
    "title": "KAi/analytics API",
    "version": "1.0.0",
    "description": "API v1 di KAi/analytics (KaiGrid). Le letture accettano la sessione dell'app oppure una chiave API di lettura (Authorization: Bearer kai_…), creata in «API e integrazioni». Periodo: start/end (date nel fuso del dominio) oppure from/to (istanti UTC). Semantica: docs/API-V1.md."
  },
  "servers": [
    {
      "url": "https://analytics.kaigrid.ai"
    }
  ],
  "tags": [
    {
      "name": "Letture",
      "description": "Statistiche per dominio, con gli stessi filtri dell'app"
    },
    {
      "name": "Chiavi API"
    },
    {
      "name": "Raccolta"
    }
  ],
  "paths": {
    "/api/v1/organizations/{organization_id}/properties/{property_id}/sessions": {
      "get": {
        "operationId": "getSessions",
        "tags": [
          "Letture"
        ],
        "summary": "Sessioni del periodo, dalla più recente (paginate con cursore).",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "visitor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPage"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/overview": {
      "get": {
        "operationId": "getOverview",
        "tags": [
          "Letture"
        ],
        "summary": "Metriche del periodo, con il periodo di confronto.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overview"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/timeseries": {
      "get": {
        "operationId": "getTimeseries",
        "tags": [
          "Letture"
        ],
        "summary": "Andamento per giorno o per ora.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "hour"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeSeries"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/breakdown": {
      "get": {
        "operationId": "getBreakdown",
        "tags": [
          "Letture"
        ],
        "summary": "Ripartizione per una dimensione (canale, sorgente, campagna, pagina, paese…).",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "dimension",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "channel",
                "source",
                "medium",
                "campaign",
                "landing_page",
                "device",
                "site",
                "country",
                "agent_kind",
                "network_signal",
                "region",
                "city",
                "as_org",
                "risk_level",
                "browser",
                "os",
                "referrer",
                "ai_source",
                "visitor_type",
                "resolution",
                "trust_level",
                "event",
                "keyword",
                "ad"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Breakdown"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/realtime": {
      "get": {
        "operationId": "getRealtime",
        "tags": [
          "Letture"
        ],
        "summary": "Visitatori attivi negli ultimi 5 o 10 minuti.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "window_minutes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "5",
                "10"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Realtime"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/sessions/{session_id}": {
      "get": {
        "operationId": "getSessionsSessionId",
        "tags": [
          "Letture"
        ],
        "summary": "Scheda di una sessione.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetail"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/conversions": {
      "get": {
        "operationId": "getConversions",
        "tags": [
          "Letture"
        ],
        "summary": "Conversioni confermate dal server del sito.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversions"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/retention": {
      "get": {
        "operationId": "getRetention",
        "tags": [
          "Letture"
        ],
        "summary": "Fidelizzazione per coorti settimanali.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Retention"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/traffic-quality": {
      "get": {
        "operationId": "getTraffic-quality",
        "tags": [
          "Letture"
        ],
        "summary": "Qualità del traffico: persone, aperture senza interazione, sospetti, robot; per canale, campagna e giorno, con le conversioni.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrafficQuality"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/quality": {
      "get": {
        "operationId": "getQuality",
        "tags": [
          "Letture"
        ],
        "summary": "Qualità del traffico: anomalie dei clic, IP ripetuti, back-link, crawler, reti.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "report",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "fraud",
                "keywords",
                "offenders",
                "referrers",
                "crawlers",
                "networks"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quality"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/interests": {
      "get": {
        "operationId": "getInterests",
        "tags": [
          "Letture"
        ],
        "summary": "Interessi dei visitatori: argomenti, prodotti, provenienze, categorie.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "report",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "topics",
                "items",
                "origins",
                "categories"
              ]
            }
          },
          {
            "name": "visitor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interests"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/commerce": {
      "get": {
        "operationId": "getCommerce",
        "tags": [
          "Letture"
        ],
        "summary": "E-commerce: ricavi, ordini, funnel d'acquisto, prodotti, canali, campagne, negozi.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "report",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "funnel",
                "products",
                "orders",
                "channels",
                "campaigns",
                "stores",
                "abandonment",
                "issues",
                "customers",
                "countries",
                "interest"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Commerce"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/realtime/places": {
      "get": {
        "operationId": "getRealtimePlaces",
        "tags": [
          "Letture"
        ],
        "summary": "Visitatori attivi per città.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "window_minutes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "5",
                "10"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimePlaces"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/behavior": {
      "get": {
        "operationId": "getBehavior",
        "tags": [
          "Letture"
        ],
        "summary": "Comportamento: pagine, eventi, percorsi, 404, errori, funnel.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "report",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pages",
                "events",
                "transitions",
                "not_found",
                "errors",
                "funnel"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "views",
                "active"
              ]
            }
          },
          {
            "name": "steps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 2600
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Behavior"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/sessions/{session_id}/pages": {
      "get": {
        "operationId": "getSessionsSessionIdPages",
        "tags": [
          "Letture"
        ],
        "summary": "Pagine viste di una sessione.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageViewPage"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/sessions/{session_id}/events": {
      "get": {
        "operationId": "getSessionsSessionIdEvents",
        "tags": [
          "Letture"
        ],
        "summary": "Eventi di una sessione.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/visitors/{visitor_id}/sessions": {
      "get": {
        "operationId": "getVisitorsVisitorIdSessions",
        "tags": [
          "Letture"
        ],
        "summary": "Sessioni di un visitatore.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "visitor_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitPage"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/companies": {
      "get": {
        "operationId": "getCompanies",
        "tags": [
          "Letture"
        ],
        "summary": "Aziende ed enti che hanno visitato il sito, con visite, pagine e conversioni.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companies"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/backlinks": {
      "get": {
        "operationId": "getBacklinks",
        "tags": [
          "Letture"
        ],
        "summary": "Back-link: siti che ti linkano e ti portano visite, con visite, coinvolgimento, conversioni, controllo del link e giudizio (positivo, neutro, da verificare, negativo).",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-9]|[1-9][0-9]|100)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Backlinks"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/search": {
      "get": {
        "operationId": "getSearch",
        "tags": [
          "Letture"
        ],
        "summary": "Ricerca: impressioni, clic, CTR e posizione media da Google Search Console o Bing Webmaster Tools, per giorno, ricerca e pagina, con il periodo di confronto e le visite organiche da quel motore per pagina.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "engine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "google",
                "bing"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Search"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/fraud-evidence": {
      "get": {
        "operationId": "getFraud-evidence",
        "tags": [
          "Letture"
        ],
        "summary": "Rapporto dei clic a pagamento di una campagna (GCLID, data e ora, IP, rete, comportamento, motivi) per una richiesta di verifica alla piattaforma di advertising.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "for_campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,3}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FraudEvidence"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/history": {
      "get": {
        "operationId": "getHistory",
        "tags": [
          "Letture"
        ],
        "summary": "Storico mensile anonimo: i numeri della Panoramica per mese, anche dopo la cancellazione dei dati delle persone.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "dimension",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "total",
                "channel",
                "source",
                "campaign",
                "landing",
                "country",
                "device",
                "commerce"
              ]
            }
          },
          {
            "name": "from_month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
            }
          },
          {
            "name": "to_month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/History"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/realtime/visitors": {
      "get": {
        "operationId": "getRealtimeVisitors",
        "tags": [
          "Letture"
        ],
        "summary": "Visitatori attivi adesso: nuovi o di ritorno, pagina attuale, provenienza, dispositivo, luogo, carrello.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "window_minutes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "5",
                "10"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati e metadati del periodo (meta)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeVisitors"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/summary": {
      "get": {
        "operationId": "getMarketingSummary",
        "tags": [
          "Letture"
        ],
        "summary": "Marketing: costi, valore, ROAS, ROI, CPA, CPC, CAC, LTV, CLV, campagne, KPI.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "include_suspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sintesi economica del periodo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Marketing"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/conversions": {
      "get": {
        "operationId": "getMarketingConversions",
        "tags": [
          "Letture"
        ],
        "summary": "Conversioni reali per obiettivo e livello (intenzione, tentativo, verificata, confermata), valide e sospette con i motivi.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "include_suspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversioni del periodo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingConversions"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/funnel": {
      "get": {
        "operationId": "getMarketingFunnel",
        "tags": [
          "Letture"
        ],
        "summary": "Funnel salvato (funnel_id) o definito al volo (definition, JSON): passi, tassi, tempi e diagnosi degli abbandoni.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "funnel_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "definition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 4000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report del funnel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingFunnel"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/diagnosis": {
      "get": {
        "operationId": "getConversionDiagnosis",
        "tags": [
          "Letture"
        ],
        "summary": "Perché si converte o no: chi converte contro chi no, tassi per dimensione, contenuti, segnalazioni.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "include_suspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati del periodo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingDiagnosis"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/forms": {
      "get": {
        "operationId": "getConversionForms",
        "tags": [
          "Letture"
        ],
        "summary": "Moduli: inizio, invio, riuscito, abbandoni ed errori per campo.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "include_suspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "compare_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "compare_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "compare_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati del periodo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingForms"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/properties/{property_id}/marketing/attribution": {
      "get": {
        "operationId": "getConversionAttribution",
        "tags": [
          "Letture"
        ],
        "summary": "Attribuzione tra visite: prima, ultima, ultima non diretta, lineare.",
        "security": [
          {
            "applicationSession": []
          },
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "Z$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other)(?:,(?:direct|organic_search|paid_search|organic_social|paid_social|referral|email|ai|display|other))*$",
              "maxLength": 200
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile",
                "tablet",
                "tv",
                "other",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "agent_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unknown",
                "likely_real",
                "likely_bot",
                "verified_bot",
                "crawler"
              ]
            }
          },
          {
            "name": "network_signal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "vpn",
                "proxy",
                "datacenter",
                "tor"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 45
            }
          },
          {
            "name": "risk_level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:low|medium|high|critical)(?:,(?:low|medium|high|critical))*$",
              "maxLength": 40
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "visitor_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "include_suspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "channel",
                "source",
                "campaign"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dati del periodo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingAttribution"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/key": {
      "get": {
        "operationId": "getApiKey",
        "tags": [
          "Chiavi API"
        ],
        "summary": "La chiave usata: organizzazione, domini e siti leggibili, ambito, scadenza.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Chiave valida",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "organization",
                    "properties"
                  ],
                  "properties": {
                    "key": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "scope",
                        "expires_at"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "scope": {
                          "enum": [
                            "read",
                            "read_no_ip"
                          ]
                        },
                        "expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "organization": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "properties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "name",
                          "timezone",
                          "sites"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "sites": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "id",
                                "name",
                                "origin"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "origin": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "Chiavi API"
        ],
        "summary": "Chiavi dell'organizzazione (solo Admin e Developer di tutta l'organizzazione).",
        "security": [
          {
            "applicationSession": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Elenco",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "items",
                    "canManage"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "name",
                          "prefix",
                          "scope",
                          "property_ids",
                          "createdAt",
                          "expiresAt",
                          "lastUsedAt",
                          "revokedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "scope": {
                            "enum": [
                              "read",
                              "read_no_ip"
                            ]
                          },
                          "property_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastUsedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revokedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdByName": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ownerActive": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "canManage": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "Chiavi API"
        ],
        "summary": "Nuova chiave: il segreto (token) si riceve solo in questa risposta. Richiede Origin e X-CSRF-Token.",
        "security": [
          {
            "applicationSession": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "scope",
                  "property_ids"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "scope": {
                    "enum": [
                      "read",
                      "read_no_ip"
                    ]
                  },
                  "property_ids": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "expires_in_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365,
                    "description": "Predefinito 365: una chiave dura al massimo un anno."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "item",
                    "token"
                  ],
                  "properties": {
                    "item": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "prefix",
                        "scope",
                        "property_ids",
                        "createdAt",
                        "expiresAt",
                        "lastUsedAt",
                        "revokedAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "scope": {
                          "enum": [
                            "read",
                            "read_no_ip"
                          ]
                        },
                        "property_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastUsedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdByName": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ownerActive": {
                          "type": "boolean"
                        }
                      }
                    },
                    "token": {
                      "type": "string",
                      "pattern": "^kai_[A-Za-z0-9]{12}_[A-Za-z0-9_-]{43}$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Limite di 50 chiavi attive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/api-keys/{id}/renew": {
      "post": {
        "operationId": "renewApiKey",
        "tags": [
          "Chiavi API"
        ],
        "summary": "Rinnova una chiave: copia con un segreto nuovo, un anno, a nome di chi rinnova; la vecchia resta finché non si revoca.",
        "security": [
          {
            "applicationSession": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Rinnovata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "item",
                    "token"
                  ],
                  "properties": {
                    "item": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "prefix",
                        "scope",
                        "property_ids",
                        "createdAt",
                        "expiresAt",
                        "lastUsedAt",
                        "revokedAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "scope": {
                          "enum": [
                            "read",
                            "read_no_ip"
                          ]
                        },
                        "property_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastUsedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revokedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdByName": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ownerActive": {
                          "type": "boolean"
                        }
                      }
                    },
                    "token": {
                      "type": "string",
                      "pattern": "^kai_[A-Za-z0-9]{12}_[A-Za-z0-9_-]{43}$"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Limite di 50 chiavi attive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{organization_id}/api-keys/{id}/revoke": {
      "post": {
        "operationId": "revokeApiKey",
        "tags": [
          "Chiavi API"
        ],
        "summary": "Revoca una chiave (subito, per sempre).",
        "security": [
          {
            "applicationSession": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revocata"
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Risorsa inesistente nell'ambito autorizzato",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/collect": {
      "post": {
        "operationId": "postCollect",
        "tags": [
          "Raccolta"
        ],
        "summary": "Raccolta dal browser (codice di monitoraggio t.js).",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Collect"
              }
            },
            "text/plain": {
              "schema": {
                "$ref": "#/components/schemas/Collect"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accettato in modo durevole; l'elaborazione può essere ancora in corso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Corpo troppo grande",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/conversions/confirm": {
      "post": {
        "operationId": "postConfirm",
        "tags": [
          "Raccolta"
        ],
        "summary": "Conferma di una conversione dal server del sito (chiave server del dominio).",
        "security": [
          {
            "conversionToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Confirm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accettata in modo durevole",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmationReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stessa conferma con dati diversi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/commerce/orders": {
      "post": {
        "operationId": "postCommerceOrder",
        "tags": [
          "Raccolta"
        ],
        "summary": "Ordine e-commerce dal server del sito (crea o aggiorna, idempotente per order_id): stato, importi in centesimi, righe, negozio. Crea la conferma «purchase».",
        "security": [
          {
            "conversionToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status",
                  "occurred_at",
                  "currency",
                  "total_minor",
                  "items"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "status": {
                    "enum": [
                      "placed",
                      "paid",
                      "cancelled",
                      "refunded"
                    ]
                  },
                  "occurred_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  "site": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2048,
                        "pattern": "^https://[^/]+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "store": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visitor_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "session_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "total_minor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "subtotal_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tax_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shipping_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "discount_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "refunded_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "coupon": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "items": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "price_minor",
                        "quantity"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "category": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "variant": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "brand": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "price_minor": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100000
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordine aggiornato o già ricevuto uguale",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "order_id",
                    "created",
                    "duplicate",
                    "attributed",
                    "request_id"
                  ],
                  "properties": {
                    "order_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "duplicate": {
                      "type": "boolean"
                    },
                    "attributed": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Ordine nuovo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "order_id",
                    "created",
                    "duplicate",
                    "attributed",
                    "request_id"
                  ],
                  "properties": {
                    "order_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "duplicate": {
                      "type": "boolean"
                    },
                    "attributed": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/commerce/orders/{order_id}/status": {
      "post": {
        "operationId": "postCommerceOrderStatus",
        "tags": [
          "Raccolta"
        ],
        "summary": "Cambio di stato di un ordine: paid (incassato), cancelled, refunded (annullano la conferma), con rimborso parziale facoltativo.",
        "security": [
          {
            "conversionToken": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "enum": [
                      "placed",
                      "paid",
                      "cancelled",
                      "refunded"
                    ]
                  },
                  "refunded_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stato aggiornato",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "order_id",
                    "status",
                    "request_id"
                  ],
                  "properties": {
                    "order_id": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "placed",
                        "paid",
                        "cancelled",
                        "refunded"
                      ]
                    },
                    "request_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Accesso richiesto: sessione dell'app o chiave API valida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ordine sconosciuto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Rimborso oltre il totale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/recordings": {
      "post": {
        "operationId": "postRecording",
        "tags": [
          "Raccolta"
        ],
        "security": [],
        "summary": "Registratore eventi: cronologia strutturale inviata dal sito durante una registrazione (codice del link, mai valori dei campi). Origin del sito obbligatoria.",
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "property_key",
                  "token",
                  "action"
                ],
                "properties": {
                  "property_key": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{40}$"
                  },
                  "action": {
                    "enum": [
                      "signals",
                      "ping",
                      "stop"
                    ]
                  },
                  "page_uid": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{16}$"
                  },
                  "signals": {
                    "type": "array",
                    "maxItems": 600,
                    "items": {
                      "type": "object",
                      "required": [
                        "seq",
                        "t",
                        "kind"
                      ],
                      "properties": {
                        "seq": {
                          "type": "integer"
                        },
                        "t": {
                          "type": "number"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        },
                        "d": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stato della registrazione",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "active",
                    "accepted",
                    "count",
                    "remaining_sec"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": "string"
                    },
                    "accepted": {
                      "type": "integer"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining_sec": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Registrazione inesistente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tracker-config": {
      "get": {
        "operationId": "getTrackerConfig",
        "tags": [
          "Raccolta"
        ],
        "security": [],
        "summary": "Regole attive del dominio, piattaforma e-commerce e zone non misurate del sito per il codice di monitoraggio (Origin del sito obbligatoria).",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Regole e piattaforma e-commerce del sito",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rules"
                  ],
                  "properties": {
                    "commerce": {
                      "description": "Piattaforma e-commerce del sito della pagina (modulo t-commerce-<piattaforma>.js); null se non è un negozio",
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unmeasured": {
                      "description": "Zone non misurate del sito (#47): percorsi esatti o prefissi con «*» finale dove il codice non raccoglie nulla (app e PWA nello stesso dominio)",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "type",
                          "attempt",
                          "success",
                          "form"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "enum": [
                              "form",
                              "action"
                            ]
                          },
                          "attempt": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "success": {
                            "type": "object"
                          },
                          "form": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "pages": {
                            "description": "Dove vale: null = ovunque, in tutte le lingue",
                            "anyOf": [
                              {
                                "type": "null"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "paths": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "all_languages": {
                                    "type": "boolean"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Richiesta non valida (parametri non ammessi o fuori formato)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Ruolo o ambito insufficiente",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Troppe richieste: riprovare dopo Retry-After secondi",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Servizio momentaneamente non disponibile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "applicationSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-kai_session",
        "description": "Sessione dell'app (accesso KaiGrid)."
      },
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Chiave API di lettura: kai_<prefisso>_<segreto>. Ambito «read» (come un Analyst) o «read_no_ip» (come un Reader)."
      },
      "conversionToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Chiave server del dominio per le conferme di conversione."
      }
    },
    "schemas": {
      "SessionPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "last_activity_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "page_views": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "events": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "active_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "risk": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "score": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "confidence": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            "reasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "rules_version": {
                              "type": "string"
                            },
                            "level": {
                              "enum": [
                                "low",
                                "medium",
                                "high",
                                "critical"
                              ]
                            }
                          },
                          "required": [
                            "score",
                            "confidence",
                            "reasons",
                            "rules_version",
                            "level"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ended_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "Z$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ip": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "channel": {
                      "enum": [
                        "direct",
                        "organic_search",
                        "paid_search",
                        "organic_social",
                        "paid_social",
                        "referral",
                        "email",
                        "ai",
                        "display",
                        "other"
                      ]
                    },
                    "medium": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "ad_group": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "ad": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "keyword": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "ad_group",
                            "ad",
                            "keyword"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "city": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "company": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "classification": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "agent_kind": {
                          "enum": [
                            "unknown",
                            "likely_real",
                            "likely_bot",
                            "verified_bot",
                            "crawler"
                          ]
                        },
                        "network_signals": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "enum": [
                              "vpn",
                              "proxy",
                              "datacenter",
                              "tor"
                            ]
                          }
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "evidence": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "rules_version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "agent_kind",
                        "network_signals",
                        "confidence",
                        "evidence",
                        "rules_version"
                      ]
                    },
                    "visitor_sessions": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "event_types": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "conversions": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "server_confirmed": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "rule_verified": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "attempts_without_confirmation": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "server_confirmed",
                        "rule_verified",
                        "attempts_without_confirmation"
                      ]
                    },
                    "visible_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device": {
                      "enum": [
                        "desktop",
                        "mobile",
                        "tablet",
                        "tv",
                        "other",
                        "unknown"
                      ]
                    },
                    "browser": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "os": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "os_version": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device_model": {
                      "description": "08/10: modello dal client hint del browser (Chromium, con il consenso).",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "landing_path": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "other_sites_page_views": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "#28 fase 2: pagine della sessione sugli altri siti del dominio, non visibili a chi legge solo alcuni siti; null = vede tutto. Facoltativo."
                    },
                    "event_names": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      "description": "Punto 1: nomi di eventi e obiettivi della visita."
                    },
                    "duration_ms": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "Dall'inizio all'ultima attività."
                    },
                    "trust": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "score",
                            "level",
                            "reasons",
                            "rules_version"
                          ],
                          "properties": {
                            "score": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "level": {
                              "enum": [
                                "high",
                                "medium",
                                "low"
                              ]
                            },
                            "reasons": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "maxLength": 64
                              }
                            },
                            "rules_version": {
                              "type": "string",
                              "maxLength": 32
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Affidabilità (trust-v1): quanto la visita sembra di una persona reale, distinta dal rischio."
                    },
                    "company_source": {
                      "description": "07/10: da dove viene il nome dell'azienda: manual (annotata), registry (registro degli indirizzi), rdns (nome inverso), network (rete non domestica o cloud).",
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "manual",
                            "registry",
                            "rdns",
                            "network"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "consent": {
                      "description": "#39 GDPR: consenso del visitatore. level 0 = solo tecnici (visita anonima), 1 = statistiche, 2 = statistiche e registrazione; categories = categorie del banner accettate (true) o rifiutate (false). null = il dominio non chiede il consenso.",
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "level",
                            "categories"
                          ],
                          "properties": {
                            "level": {
                              "enum": [
                                0,
                                1,
                                2
                              ]
                            },
                            "categories": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "boolean"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "visitor_id",
                    "started_at",
                    "last_activity_at",
                    "source",
                    "page_views",
                    "events",
                    "active_ms",
                    "risk",
                    "ended_at",
                    "ip",
                    "channel",
                    "medium",
                    "campaign",
                    "country",
                    "city",
                    "company",
                    "classification",
                    "visitor_sessions",
                    "event_types",
                    "conversions",
                    "visible_ms",
                    "device",
                    "browser",
                    "os",
                    "landing_path",
                    "event_names",
                    "duration_ms",
                    "trust"
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "items",
              "next_cursor"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Overview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "visitors": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sessions_started": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sessions_with_activity": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "page_views": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "active_ms": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "server_confirmed": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rule_verified": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "attempts_without_confirmation": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "advertising_arrivals": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sessions_server_confirmed": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "visible_ms": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "visitors": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sessions_started": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sessions_with_activity": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "page_views": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "active_ms": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "server_confirmed": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rule_verified": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "attempts_without_confirmation": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "advertising_arrivals": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sessions_server_confirmed": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "visible_ms": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "new_visitors": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "returning_visitors": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "engaged_sessions": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "duration_ms": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "visitors",
                      "sessions_started",
                      "sessions_with_activity",
                      "page_views",
                      "active_ms",
                      "server_confirmed",
                      "rule_verified",
                      "attempts_without_confirmation",
                      "advertising_arrivals",
                      "sessions_server_confirmed",
                      "visible_ms",
                      "new_visitors",
                      "returning_visitors",
                      "engaged_sessions",
                      "duration_ms"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "new_visitors": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "returning_visitors": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "engaged_sessions": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "duration_ms": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "visitors",
              "sessions_started",
              "sessions_with_activity",
              "page_views",
              "active_ms",
              "server_confirmed",
              "rule_verified",
              "attempts_without_confirmation",
              "advertising_arrivals",
              "sessions_server_confirmed",
              "visible_ms",
              "previous",
              "new_visitors",
              "returning_visitors",
              "engaged_sessions",
              "duration_ms"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "TimeSeries": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "interval": {
                "enum": [
                  "day",
                  "hour"
                ]
              },
              "points": {
                "type": "array",
                "maxItems": 400,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "previous_date": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "current": {
                      "type": "object",
                      "minProperties": 1,
                      "additionalProperties": false,
                      "properties": {
                        "visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_started": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_with_activity": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "page_views": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "active_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "server_confirmed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rule_verified": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attempts_without_confirmation": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "advertising_arrivals": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_server_confirmed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "visible_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "new_visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "returning_visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "engaged_sessions": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "duration_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "type": "object",
                          "minProperties": 1,
                          "additionalProperties": false,
                          "properties": {
                            "visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_started": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_with_activity": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "page_views": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "active_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "server_confirmed": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rule_verified": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "attempts_without_confirmation": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "advertising_arrivals": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_server_confirmed": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "visible_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "new_visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "returning_visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "engaged_sessions": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "duration_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hour": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 23,
                      "description": "#9: ora locale del punto (solo interval=hour)."
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "#9: inizio dell'ora (UTC) nel periodo (solo interval=hour)."
                    },
                    "previous_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "date",
                    "previous_date",
                    "current",
                    "previous"
                  ]
                }
              }
            },
            "required": [
              "interval",
              "points"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Breakdown": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "dimension": {
                "enum": [
                  "channel",
                  "source",
                  "medium",
                  "campaign",
                  "landing_page",
                  "device",
                  "country",
                  "agent_kind",
                  "network_signal",
                  "site",
                  "region",
                  "city",
                  "as_org",
                  "risk_level",
                  "browser",
                  "os",
                  "referrer",
                  "ai_source",
                  "visitor_type",
                  "resolution",
                  "trust_level",
                  "event",
                  "keyword",
                  "ad"
                ]
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "current": {
                      "type": "object",
                      "minProperties": 1,
                      "additionalProperties": false,
                      "properties": {
                        "visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_started": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_with_activity": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "page_views": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "active_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "server_confirmed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rule_verified": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attempts_without_confirmation": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "advertising_arrivals": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions_server_confirmed": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "visible_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "new_visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "returning_visitors": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "engaged_sessions": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "duration_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "type": "object",
                          "minProperties": 1,
                          "additionalProperties": false,
                          "properties": {
                            "visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_started": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_with_activity": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "page_views": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "active_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "server_confirmed": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rule_verified": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "attempts_without_confirmation": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "advertising_arrivals": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sessions_server_confirmed": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "visible_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "new_visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "returning_visitors": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "engaged_sessions": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "duration_ms": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "key",
                    "current",
                    "previous"
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "dimension",
              "items",
              "next_cursor"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Realtime": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "active_visitors": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "active_sessions": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "active_visitors",
              "active_sessions"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "window_minutes": {
                "type": "integer",
                "enum": [
                  5,
                  10
                ]
              },
              "as_of": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              }
            },
            "required": [
              "window_minutes",
              "as_of",
              "from",
              "processed_through",
              "demo"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "SessionDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "summary": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "visitor_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "started_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  "last_activity_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "page_views": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "events": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "active_ms": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "risk": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "score": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                          },
                          "confidence": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "rules_version": {
                            "type": "string"
                          },
                          "level": {
                            "enum": [
                              "low",
                              "medium",
                              "high",
                              "critical"
                            ]
                          }
                        },
                        "required": [
                          "score",
                          "confidence",
                          "reasons",
                          "rules_version",
                          "level"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ended_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "Z$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ip": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "channel": {
                    "enum": [
                      "direct",
                      "organic_search",
                      "paid_search",
                      "organic_social",
                      "paid_social",
                      "referral",
                      "email",
                      "ai",
                      "display",
                      "other"
                    ]
                  },
                  "medium": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "campaign": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ad_group": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ad": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "keyword": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "ad_group",
                          "ad",
                          "keyword"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "company": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "classification": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "agent_kind": {
                        "enum": [
                          "unknown",
                          "likely_real",
                          "likely_bot",
                          "verified_bot",
                          "crawler"
                        ]
                      },
                      "network_signals": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "enum": [
                            "vpn",
                            "proxy",
                            "datacenter",
                            "tor"
                          ]
                        }
                      },
                      "confidence": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "evidence": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "rules_version": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "agent_kind",
                      "network_signals",
                      "confidence",
                      "evidence",
                      "rules_version"
                    ]
                  },
                  "visitor_sessions": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "event_types": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "conversions": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "server_confirmed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "rule_verified": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "attempts_without_confirmation": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "server_confirmed",
                      "rule_verified",
                      "attempts_without_confirmation"
                    ]
                  },
                  "visible_ms": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "device": {
                    "enum": [
                      "desktop",
                      "mobile",
                      "tablet",
                      "tv",
                      "other",
                      "unknown"
                    ]
                  },
                  "browser": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "os": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "os_version": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "device_model": {
                    "description": "08/10: modello dal client hint del browser (Chromium, con il consenso).",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "landing_path": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "other_sites_page_views": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "#28 fase 2: pagine della sessione sugli altri siti del dominio, non visibili a chi legge solo alcuni siti; null = vede tutto. Facoltativo."
                  },
                  "event_names": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "description": "Punto 1: nomi di eventi e obiettivi della visita."
                  },
                  "duration_ms": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991,
                    "description": "Dall'inizio all'ultima attività."
                  },
                  "trust": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "score",
                          "level",
                          "reasons",
                          "rules_version"
                        ],
                        "properties": {
                          "score": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100
                          },
                          "level": {
                            "enum": [
                              "high",
                              "medium",
                              "low"
                            ]
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 64
                            }
                          },
                          "rules_version": {
                            "type": "string",
                            "maxLength": 32
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Affidabilità (trust-v1): quanto la visita sembra di una persona reale, distinta dal rischio."
                  },
                  "company_source": {
                    "description": "07/10: da dove viene il nome dell'azienda: manual (annotata), registry (registro degli indirizzi), rdns (nome inverso), network (rete non domestica o cloud).",
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "manual",
                          "registry",
                          "rdns",
                          "network"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "consent": {
                    "description": "#39 GDPR: consenso del visitatore. level 0 = solo tecnici (visita anonima), 1 = statistiche, 2 = statistiche e registrazione; categories = categorie del banner accettate (true) o rifiutate (false). null = il dominio non chiede il consenso.",
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "level",
                          "categories"
                        ],
                        "properties": {
                          "level": {
                            "enum": [
                              0,
                              1,
                              2
                            ]
                          },
                          "categories": {
                            "anyOf": [
                              {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "boolean"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "visitor_id",
                  "started_at",
                  "last_activity_at",
                  "source",
                  "page_views",
                  "events",
                  "active_ms",
                  "risk",
                  "ended_at",
                  "ip",
                  "channel",
                  "medium",
                  "campaign",
                  "country",
                  "city",
                  "company",
                  "classification",
                  "visitor_sessions",
                  "event_types",
                  "conversions",
                  "visible_ms",
                  "device",
                  "browser",
                  "os",
                  "landing_path",
                  "event_names",
                  "duration_ms",
                  "trust"
                ]
              },
              "attribution": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "source": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "medium": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "campaign": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "utm": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "utm_source": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "utm_medium": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "utm_campaign": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "utm_term": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "utm_content": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "utm_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "utm_source",
                          "utm_medium",
                          "utm_campaign",
                          "utm_term",
                          "utm_content",
                          "utm_id"
                        ]
                      },
                      "click_ids": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "gclid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gbraid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "wbraid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "fbclid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "msclkid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ttclid": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "li_fat_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "gclid",
                          "gbraid",
                          "wbraid",
                          "fbclid",
                          "msclkid",
                          "ttclid",
                          "li_fat_id"
                        ]
                      },
                      "landing_url": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "referrer_url": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ai": {
                        "anyOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "source": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "confidence": {
                                "anyOf": [
                                  {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "match": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "source",
                              "channel",
                              "confidence",
                              "match"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "attribution_sanitized": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "source",
                      "medium",
                      "campaign",
                      "utm",
                      "click_ids",
                      "landing_url",
                      "referrer_url",
                      "ai",
                      "attribution_sanitized"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "technology": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "browser": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "os": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "device": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "resolution": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "user_agent": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "browser",
                      "os",
                      "device",
                      "resolution",
                      "user_agent"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "network": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "country": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "region": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "as_org": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "isp": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rdns": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cloud": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "company_type": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "company_domain": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "business_identity": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "network_owner": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "identity_type": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "match_source": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "asn": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "trust_score": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "flags": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "country",
                      "region",
                      "city",
                      "as_org",
                      "isp",
                      "rdns",
                      "cloud",
                      "company_type",
                      "company_domain",
                      "carrier",
                      "business_identity",
                      "network_owner",
                      "identity_type",
                      "match_source",
                      "asn",
                      "trust_score",
                      "flags"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "classification": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "agent_kind": {
                    "enum": [
                      "unknown",
                      "likely_real",
                      "likely_bot",
                      "verified_bot",
                      "crawler"
                    ]
                  },
                  "network_signals": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "enum": [
                        "vpn",
                        "proxy",
                        "datacenter",
                        "tor"
                      ]
                    }
                  },
                  "confidence": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "evidence": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "rules_version": {
                    "type": "string"
                  }
                },
                "required": [
                  "agent_kind",
                  "network_signals",
                  "confidence",
                  "evidence",
                  "rules_version"
                ]
              },
              "history": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "visitor_sessions": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "same_ip_sessions": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "total_page_views": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "consent": {
                    "description": "#39 GDPR: consenso del visitatore. level 0 = solo tecnici (visita anonima), 1 = statistiche, 2 = statistiche e registrazione; categories = categorie del banner accettate (true) o rifiutate (false). null = il dominio non chiede il consenso.",
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "level",
                          "categories"
                        ],
                        "properties": {
                          "level": {
                            "enum": [
                              0,
                              1,
                              2
                            ]
                          },
                          "categories": {
                            "anyOf": [
                              {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "boolean"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "identified": {
                    "description": "Identità tra dispositivi (072): il sito ha identificato il visitatore con kai(\"identify\"); storico e sessioni sono della persona.",
                    "type": "boolean"
                  },
                  "devices": {
                    "description": "Browser o dispositivi della stessa persona (1 senza identità).",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000
                  }
                },
                "required": [
                  "visitor_sessions",
                  "same_ip_sessions",
                  "total_page_views"
                ]
              },
              "search": {
                "description": "28/10: ricerche probabili di una visita organica da Google o da Bing, dalla pagina d'ingresso (Google Search Console, Bing Webmaster Tools): le ricerche che hanno portato a quella pagina nei giorni attorno alla visita (±7) (basis weeks) o in tutto il periodo noto (all). Stima, non la ricerca della persona. null per le altre visite o senza dati.",
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "engine",
                      "basis",
                      "items"
                    ],
                    "properties": {
                      "engine": {
                        "type": "string",
                        "enum": [
                          "google",
                          "bing"
                        ]
                      },
                      "basis": {
                        "enum": [
                          "weeks",
                          "all"
                        ]
                      },
                      "items": {
                        "type": "array",
                        "maxItems": 5,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "query",
                            "impressions",
                            "clicks"
                          ],
                          "properties": {
                            "query": {
                              "type": "string"
                            },
                            "impressions": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "clicks": {
                              "type": "integer",
                              "minimum": 0
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            },
            "required": [
              "summary",
              "attribution",
              "technology",
              "network",
              "classification",
              "history",
              "search"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Conversions": {
        "description": "#25 punto 3: conferme di conversione del periodo (occurred_at), totali per obiettivo e valuta, non attribuite a parte.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "totals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "goal_key": {
                      "type": "string"
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "value_minor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attributed": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "goal_key",
                    "currency",
                    "count",
                    "value_minor",
                    "attributed"
                  ]
                }
              },
              "unattributed": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "confirmation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "goal_key": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "value_minor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "external_reference": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "session_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "risk_level": {
                      "anyOf": [
                        {
                          "enum": [
                            "low",
                            "medium",
                            "high",
                            "critical"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "confirmation_id",
                    "goal_key",
                    "occurred_at",
                    "value_minor",
                    "currency",
                    "external_reference",
                    "session_id",
                    "channel",
                    "source",
                    "campaign",
                    "risk_level"
                  ]
                }
              }
            },
            "required": [
              "complete",
              "totals",
              "unattributed",
              "items"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Retention": {
        "description": "Punto 1 (02/10): fidelizzazione per coorti settimanali dei nuovi visitatori; returning[k] = visitatori della coorte tornati nella settimana k (0 = la stessa), null per settimane non ancora trascorse.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "interval",
              "weeks",
              "complete",
              "cohorts"
            ],
            "properties": {
              "interval": {
                "const": "week"
              },
              "weeks": {
                "type": "integer",
                "minimum": 1,
                "maximum": 52
              },
              "complete": {
                "type": "boolean"
              },
              "cohorts": {
                "type": "array",
                "maxItems": 60,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "start",
                    "visitors",
                    "returning"
                  ],
                  "properties": {
                    "start": {
                      "type": "string",
                      "format": "date"
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "returning": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "TrafficQuality": {
        "description": "24/10: qualità del traffico. Tutte le visite del periodo in quattro gruppi che non si sovrappongono: person (persone con almeno un'azione), idle (aperture senza interazione), suspect (rischio alto o critico, reti mascherate), robot (bot riconosciuti e pagine mai mostrate). Per totali con confronto, canali, campagne e giorni; tempo attivo medio delle persone in secondi; conversioni dell'area Conversioni; consenso registrato. complete=false: visite ancora in elaborazione, nessun dato.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "groups": {
                "type": "array",
                "items": {
                  "enum": [
                    "person",
                    "idle",
                    "suspect",
                    "robot"
                  ]
                }
              },
              "totals": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "current",
                  "previous"
                ],
                "properties": {
                  "current": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "visits",
                      "person",
                      "idle",
                      "suspect",
                      "robot",
                      "person_active_s"
                    ],
                    "properties": {
                      "visits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "person": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "idle": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "suspect": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "robot": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "person_active_s": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "previous": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "visits",
                          "person",
                          "idle",
                          "suspect",
                          "robot",
                          "person_active_s"
                        ],
                        "properties": {
                          "visits": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "person": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "idle": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "suspect": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "robot": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "person_active_s": {
                            "anyOf": [
                              {
                                "type": "number",
                                "minimum": 0
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              "channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "visits",
                    "person",
                    "idle",
                    "suspect",
                    "robot",
                    "person_active_s",
                    "conversions"
                  ],
                  "properties": {
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "person": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idle": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "suspect": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "robot": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "person_active_s": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversions": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "campaigns": {
                "type": "array",
                "maxItems": 30,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "visits",
                    "person",
                    "idle",
                    "suspect",
                    "robot",
                    "person_active_s",
                    "conversions"
                  ],
                  "properties": {
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "person": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idle": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "suspect": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "robot": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "person_active_s": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversions": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "days": {
                "type": "array",
                "maxItems": 400,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "date",
                    "visits",
                    "person",
                    "idle",
                    "suspect",
                    "robot"
                  ],
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "visits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "person": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idle": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "suspect": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "robot": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "consent": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "not_asked",
                  "anonymous",
                  "consented"
                ],
                "properties": {
                  "not_asked": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "anonymous": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "consented": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "Quality": {
        "description": "Punto 3 (02/10): qualità del traffico — anomalie dei clic per campagna e parola chiave, IP con clic ripetuti, siti di provenienza sospetti, crawler, reti; ogni voce con indice e consiglio.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "report",
              "complete",
              "items"
            ],
            "properties": {
              "report": {
                "enum": [
                  "fraud",
                  "keywords",
                  "offenders",
                  "referrers",
                  "crawlers",
                  "networks"
                ]
              },
              "complete": {
                "type": "boolean"
              },
              "hidden": {
                "type": "boolean"
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      },
                      {
                        "type": "array"
                      }
                    ]
                  },
                  "properties": {
                    "advice": {
                      "type": "string",
                      "enum": [
                        "too_few",
                        "exclude_ips",
                        "exclude_networks",
                        "click_id_reuse",
                        "review_placements",
                        "healthy",
                        "referrer_spam",
                        "low_quality_link",
                        "block_fake_crawler",
                        "challenge_automation",
                        "limit_crawl_rate",
                        "allow",
                        "review_crawler",
                        "firewall_challenge",
                        "exclude_from_ads",
                        "monitor"
                      ]
                    },
                    "index": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "level": {
                      "enum": [
                        "high",
                        "medium",
                        "low"
                      ]
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "Interests": {
        "description": "Punto 5 (03/10): interessi dei visitatori — argomenti da provenienza, pagine viste e click; prodotti e articoli; parole chiave, pagine d'origine e sorgenti; categorie di interesse dell'azienda.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "report",
              "complete",
              "total_sessions",
              "total_visitors",
              "items"
            ],
            "properties": {
              "report": {
                "enum": [
                  "topics",
                  "items",
                  "origins",
                  "categories"
                ]
              },
              "complete": {
                "type": "boolean"
              },
              "total_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "total_visitors": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "maxItems": 300,
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InterestsTopic"
                    },
                    {
                      "$ref": "#/components/schemas/InterestsItem"
                    },
                    {
                      "$ref": "#/components/schemas/InterestsOrigin"
                    },
                    {
                      "$ref": "#/components/schemas/InterestsCategory"
                    }
                  ]
                }
              },
              "conversion_rate": {
                "description": "Prodotti: quota delle visite del periodo che convertono (media del sito).",
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "InterestsTopic": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "topic",
          "stem",
          "sessions",
          "visitors",
          "share",
          "score",
          "signals",
          "conversions",
          "conversion_rate",
          "top_channel",
          "top_source",
          "pages"
        ],
        "properties": {
          "topic": {
            "type": "string"
          },
          "stem": {
            "type": "string"
          },
          "sessions": {
            "type": "integer",
            "minimum": 0
          },
          "visitors": {
            "type": "integer",
            "minimum": 0
          },
          "share": {
            "type": "number",
            "minimum": 0
          },
          "score": {
            "type": "number",
            "minimum": 0
          },
          "signals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "search",
              "referrer",
              "pages",
              "clicks"
            ],
            "properties": {
              "search": {
                "type": "integer",
                "minimum": 0
              },
              "referrer": {
                "type": "integer",
                "minimum": 0
              },
              "pages": {
                "type": "integer",
                "minimum": 0
              },
              "clicks": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "conversions": {
            "type": "integer",
            "minimum": 0
          },
          "conversion_rate": {
            "type": "number",
            "minimum": 0
          },
          "top_channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "top_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "pages": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "host",
                "path",
                "title"
              ],
              "properties": {
                "host": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "InterestsItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "host",
          "path",
          "views",
          "sessions",
          "from_list",
          "top_from",
          "clicks",
          "add_to_cart",
          "conversions",
          "conversion_rate",
          "signal"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "views": {
            "type": "integer",
            "minimum": 0
          },
          "sessions": {
            "type": "integer",
            "minimum": 0
          },
          "from_list": {
            "type": "integer",
            "minimum": 0
          },
          "top_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clicks": {
            "type": "integer",
            "minimum": 0
          },
          "add_to_cart": {
            "type": "integer",
            "minimum": 0
          },
          "conversions": {
            "type": "integer",
            "minimum": 0
          },
          "conversion_rate": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "signal": {
            "description": "Interesse e contatti (#36): few_contacts = molte visite e pochi contatti rispetto alla media del sito; converts_well = molti più contatti della media.",
            "anyOf": [
              {
                "enum": [
                  "few_contacts",
                  "converts_well"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "InterestsOrigin": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "value",
          "source",
          "channel",
          "sessions",
          "visitors",
          "conversions",
          "topics"
        ],
        "properties": {
          "kind": {
            "enum": [
              "keyword",
              "referrer",
              "source"
            ]
          },
          "value": {
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sessions": {
            "type": "integer",
            "minimum": 0
          },
          "visitors": {
            "type": "integer",
            "minimum": 0
          },
          "conversions": {
            "type": "integer",
            "minimum": 0
          },
          "topics": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "InterestsCategory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "terms",
          "paths",
          "sessions",
          "visitors",
          "share",
          "conversions",
          "conversion_rate",
          "via_terms",
          "via_paths"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "terms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessions": {
            "type": "integer",
            "minimum": 0
          },
          "visitors": {
            "type": "integer",
            "minimum": 0
          },
          "share": {
            "type": "number",
            "minimum": 0
          },
          "conversions": {
            "type": "integer",
            "minimum": 0
          },
          "conversion_rate": {
            "type": "number",
            "minimum": 0
          },
          "via_terms": {
            "type": "integer",
            "minimum": 0
          },
          "via_paths": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "Commerce": {
        "description": "E-commerce (06/10): solo i siti dichiarati e-commerce. Importi in unità minori della valuta (centesimi), ricavo IVA inclusa meno rimborsi, ordini annullati esclusi. commerce: false = nessun sito e-commerce nella vista.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "report",
              "commerce",
              "complete",
              "items"
            ],
            "properties": {
              "report": {
                "enum": [
                  "summary",
                  "funnel",
                  "products",
                  "orders",
                  "channels",
                  "campaigns",
                  "stores",
                  "abandonment",
                  "issues",
                  "customers",
                  "countries",
                  "interest"
                ]
              },
              "commerce": {
                "type": "boolean"
              },
              "complete": {
                "type": "boolean"
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "enum": [
                            "sessions",
                            "view_item",
                            "add_to_cart",
                            "begin_checkout",
                            "payment_attempt",
                            "purchase"
                          ]
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "key",
                        "sessions"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "list_views": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "clicks": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "views": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "wishlist": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "add_to_cart": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "removed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unavailable": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "orders": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "revenue_minor": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "list_views",
                        "clicks",
                        "views",
                        "wishlist",
                        "add_to_cart",
                        "removed",
                        "unavailable",
                        "quantity",
                        "orders",
                        "revenue_minor"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "order_id": {
                          "type": "string"
                        },
                        "placed_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "status": {
                          "enum": [
                            "placed",
                            "paid",
                            "cancelled",
                            "refunded"
                          ]
                        },
                        "origin": {
                          "enum": [
                            "server",
                            "browser"
                          ]
                        },
                        "store": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "site_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "total_minor": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "refunded_minor": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "items": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "session_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medium": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "campaign": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "order_id",
                        "placed_at",
                        "status",
                        "origin",
                        "store",
                        "site_id",
                        "currency",
                        "total_minor",
                        "refunded_minor",
                        "items",
                        "session_id",
                        "channel",
                        "source",
                        "medium",
                        "campaign"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medium": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "campaign": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "orders": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "revenue_minor": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "items": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "key",
                        "orders",
                        "revenue_minor",
                        "items"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "step": {
                          "enum": [
                            "view_item",
                            "add_to_cart",
                            "begin_checkout",
                            "payment_attempt",
                            "purchase"
                          ]
                        },
                        "cause": {
                          "type": "string"
                        },
                        "detail": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "value_minor": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "valued_sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "step",
                        "cause",
                        "detail",
                        "sessions",
                        "value_minor",
                        "valued_sessions"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "detail": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "events": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "lost_sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "kind",
                        "detail",
                        "events",
                        "sessions",
                        "lost_sessions"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "key": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "carts": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "orders": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "revenue_minor": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "key",
                        "sessions",
                        "carts",
                        "orders",
                        "revenue_minor"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "cart_sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "checkout_sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "purchase_sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "orders": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "revenue_minor": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "orders_off_site": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unavailable": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "top_channel": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "top_obstacle": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "signal": {
                          "anyOf": [
                            {
                              "enum": [
                                "unavailable",
                                "stops_at_page",
                                "stops_at_cart",
                                "stops_at_checkout",
                                "sold_off_site",
                                "converts_well"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "sessions",
                        "cart_sessions",
                        "checkout_sessions",
                        "purchase_sessions",
                        "quantity",
                        "orders",
                        "revenue_minor",
                        "orders_off_site",
                        "unavailable",
                        "top_channel",
                        "top_obstacle",
                        "signal"
                      ]
                    }
                  ]
                }
              },
              "cart_abandoned": {
                "type": "integer",
                "minimum": 0
              },
              "checkout_abandoned": {
                "type": "integer",
                "minimum": 0
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "currency": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "revenue_minor": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "orders": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "cancelled": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "paid": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "items_sold": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "buyers": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "aov_minor": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sessions": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "purchase_sessions": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "conversion_rate": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currencies": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            },
                            "orders": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "revenue_minor": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "refunded_minor": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "currency",
                            "orders",
                            "revenue_minor",
                            "refunded_minor"
                          ]
                        }
                      },
                      "avg_cart_minor": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cart_sessions": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "currency",
                      "revenue_minor",
                      "orders",
                      "cancelled",
                      "paid",
                      "items_sold",
                      "buyers",
                      "aov_minor",
                      "sessions",
                      "purchase_sessions",
                      "conversion_rate",
                      "currencies",
                      "avg_cart_minor",
                      "cart_sessions"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revenue_minor": {
                "type": "integer",
                "minimum": 0
              },
              "orders": {
                "type": "integer",
                "minimum": 0
              },
              "cancelled": {
                "type": "integer",
                "minimum": 0
              },
              "order_updates": {
                "type": "boolean",
                "description": "Solo summary e orders (20/10): true = almeno un negozio della vista manda dal server annullamenti e rimborsi; false = gli ordini arrivano solo dalla pagina di conferma (es. HippoPlace) e cancelled, refunded_minor e gli stati annullato/rimborsato restano a zero: l'interfaccia non li mostra."
              },
              "paid": {
                "type": "integer",
                "minimum": 0
              },
              "items_sold": {
                "type": "integer",
                "minimum": 0
              },
              "buyers": {
                "type": "integer",
                "minimum": 0
              },
              "aov_minor": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sessions": {
                "type": "integer",
                "minimum": 0
              },
              "purchase_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "conversion_rate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currencies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "orders": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "revenue_minor": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "refunded_minor": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "currency",
                    "orders",
                    "revenue_minor",
                    "refunded_minor"
                  ]
                }
              },
              "series": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "orders": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "revenue_minor": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "date",
                    "orders",
                    "revenue_minor"
                  ]
                }
              },
              "avg_cart_minor": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cart_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "shipping": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "quoted_sessions": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "avg_shipping_minor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "free_sessions": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "left_after_quote": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "quoted_sessions",
                  "avg_shipping_minor",
                  "free_sessions",
                  "left_after_quote"
                ]
              },
              "average": {
                "description": "Interesse e vendite: tassi medi di tutti i prodotti (pagina → carrello → checkout → acquisto; pagina → acquisto).",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cart_rate",
                  "checkout_rate",
                  "purchase_rate",
                  "conversion_rate"
                ],
                "properties": {
                  "cart_rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "checkout_rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "purchase_rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "conversion_rate": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "RealtimePlaces": {
        "description": "Punto 3 (02/10): visitatori attivi negli ultimi 5 o 10 minuti per città (chiave come la ripartizione city), per la mappa in tempo reale.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "places"
            ],
            "properties": {
              "places": {
                "type": "array",
                "maxItems": 200,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "visitors"
                  ],
                  "properties": {
                    "key": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "window_minutes": {
                "type": "integer",
                "enum": [
                  5,
                  10
                ]
              },
              "as_of": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              }
            },
            "required": [
              "window_minutes",
              "as_of",
              "from",
              "processed_through",
              "demo"
            ]
          }
        }
      },
      "Behavior": {
        "description": "#25: letture del comportamento (pagine, eventi, percorsi, 404, errori JavaScript, funnel) sulle sessioni avviate nel periodo.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "report": {
                "enum": [
                  "pages",
                  "events",
                  "transitions",
                  "not_found",
                  "errors",
                  "funnel"
                ]
              },
              "complete": {
                "type": "boolean"
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "views": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "entries": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "exits": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "measured_views": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "avg_active_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "avg_visible_ms": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "avg_scroll_percent": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "host",
                        "path",
                        "title",
                        "views",
                        "sessions",
                        "entries",
                        "exits",
                        "measured_views",
                        "avg_active_ms",
                        "avg_visible_ms",
                        "avg_scroll_percent"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "type": {
                          "enum": [
                            "event",
                            "conversion_attempt"
                          ]
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "label": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "level": {
                          "enum": [
                            "info",
                            "warning",
                            "error"
                          ]
                        },
                        "count": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "last_path": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "name",
                        "label",
                        "level",
                        "count",
                        "sessions",
                        "last_path"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "from_host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "from_path": {
                          "type": "string"
                        },
                        "to_host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to_path": {
                          "type": "string"
                        },
                        "count": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "from_host",
                        "from_path",
                        "to_host",
                        "to_path",
                        "count",
                        "sessions"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "views": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "last_seen": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "detection": {
                          "enum": [
                            "declared",
                            "title"
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "maxItems": 3,
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "kind": {
                                "enum": [
                                  "internal",
                                  "external",
                                  "direct"
                                ]
                              },
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0
                              }
                            },
                            "required": [
                              "kind",
                              "url",
                              "count"
                            ]
                          }
                        }
                      },
                      "required": [
                        "host",
                        "path",
                        "title",
                        "views",
                        "sessions",
                        "last_seen",
                        "detection",
                        "sources"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "count": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "last_seen": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "message",
                        "host",
                        "path",
                        "count",
                        "sessions",
                        "last_seen"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "step": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 5
                        },
                        "path": {
                          "type": "string"
                        },
                        "sessions": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "step",
                        "path",
                        "sessions"
                      ]
                    }
                  ]
                }
              },
              "total_views": {
                "type": "integer",
                "minimum": 0
              },
              "total_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "total_pages": {
                "type": "integer",
                "minimum": 0,
                "description": "not_found: indirizzi distinti del periodo (non solo quelli della lista)."
              },
              "total_errors": {
                "type": "integer",
                "minimum": 0,
                "description": "errors: errori JavaScript del periodo (non solo quelli della lista)."
              },
              "sessions": {
                "type": "integer",
                "minimum": 0
              },
              "series": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "views": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "date",
                    "views"
                  ]
                }
              }
            },
            "required": [
              "report",
              "complete",
              "items"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "PageViewPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "url": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "referrer_url": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ttfb_ms": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dom_content_loaded_ms": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "load_ms": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "visible_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "active_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "scroll_percent": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "not_found_reported": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "session_id",
                    "occurred_at",
                    "url",
                    "path",
                    "referrer_url",
                    "title",
                    "ttfb_ms",
                    "dom_content_loaded_ms",
                    "load_ms",
                    "visible_ms",
                    "active_ms",
                    "scroll_percent",
                    "not_found_reported"
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "items",
              "next_cursor"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "EventPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "received_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page_url": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversion_status": {
                      "anyOf": [
                        {
                          "enum": [
                            "attempt",
                            "rule_verified",
                            "server_confirmed",
                            "reversed"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "level": {
                      "enum": [
                        "info",
                        "warning",
                        "error"
                      ]
                    },
                    "start_page_url": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "end_page_url": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evidence": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "source": {
                              "enum": [
                                "browser",
                                "server",
                                "rule"
                              ]
                            },
                            "rule_version": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "source",
                            "rule_version",
                            "reference"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "attribution_flags": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "enum": [
                          "attribution_sanitized",
                          "internal_campaign_link"
                        ]
                      }
                    },
                    "value_minor": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "#25: valore della conferma del server (unità minori), facoltativo."
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "label": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "kind": {
                              "enum": [
                                "email",
                                "phone",
                                "whatsapp"
                              ]
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "value"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "form": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rule": {
                      "description": "#31: regola del registratore che ha generato l'evento (rule_attempt, rule_success, rule_presumed): nome attuale, null se eliminata; lingua della pagina.",
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "name",
                            "lang"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lang": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "occurred_at",
                    "received_at",
                    "page_url",
                    "name",
                    "conversion_status",
                    "level",
                    "start_page_url",
                    "end_page_url",
                    "evidence",
                    "attribution_flags"
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "items",
              "next_cursor"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "VisitPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "last_activity_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page_views": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "channel": {
                      "enum": [
                        "direct",
                        "organic_search",
                        "paid_search",
                        "organic_social",
                        "paid_social",
                        "referral",
                        "email",
                        "ai",
                        "display",
                        "other"
                      ]
                    },
                    "visible_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "active_ms": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device": {
                      "description": "Dispositivo della visita: lo storico di una persona identificata comprende più dispositivi (072).",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "session_id",
                    "started_at",
                    "last_activity_at",
                    "page_views",
                    "channel",
                    "visible_ms",
                    "active_ms"
                  ]
                }
              },
              "next_cursor": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "items",
              "next_cursor"
            ]
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Companies": {
        "description": "07/10: aziende ed enti che hanno visitato il sito nel periodo. Azienda della visita: annotata a mano sul visitatore, altrimenti dal registro pubblico degli indirizzi o dal nome inverso; reti di casa, mobili e cloud escluse. Al massimo 100, per numero di visite.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete",
              "total_sessions",
              "identified_sessions",
              "items",
              "providers"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "total_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "identified_sessions": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "domain",
                    "source",
                    "sessions",
                    "visitors",
                    "page_views",
                    "active_ms",
                    "attempts",
                    "conversions",
                    "first_seen",
                    "last_seen",
                    "country",
                    "city",
                    "top_pages",
                    "recent_sessions",
                    "profile"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "domain": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "manual",
                        "registry",
                        "rdns"
                      ],
                      "description": "manual: annotata sul visitatore; registry: registro degli indirizzi (RDAP); rdns: nome inverso dell'indirizzo."
                    },
                    "sessions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "page_views": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "active_ms": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "attempts": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "conversions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "first_seen": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "last_seen": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "city": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "top_pages": {
                      "type": "array",
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "path",
                          "views"
                        ],
                        "properties": {
                          "path": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "views": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      }
                    },
                    "recent_sessions": {
                      "type": "array",
                      "maxItems": 5,
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "profile": {
                      "description": "07/10: scheda dell'azienda, Partita IVA verificata su VIES (ragione sociale e indirizzo ufficiali).",
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "vat",
                            "official_name",
                            "official_address",
                            "verified_at",
                            "verified_by"
                          ],
                          "properties": {
                            "vat": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}[A-Z0-9]{2,14}$"
                            },
                            "official_name": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "official_address": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "verified_at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "Z$"
                            },
                            "verified_by": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "providers": {
                "type": "array",
                "maxItems": 50,
                "description": "07/10: provider e reti della vista (intestatario del blocco = proprietario della rete, PeeringDB, correzioni del master): visite che non sono di un'azienda riconoscibile.",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "kind",
                    "reason",
                    "sessions",
                    "visitors",
                    "last_seen"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "isp",
                        "hosting"
                      ]
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "registry",
                            "asn_owner",
                            "peeringdb",
                            "hosting",
                            "override",
                            "rdns",
                            "generic"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sessions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "last_seen": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "Backlinks": {
        "description": "27/10: back-link che portano visite (canale referral) nel periodo, per sito che linka: visite, coinvolgimento e conversioni come nella Dashboard, bot e visite sospette, controllo della pagina che linka (link presente, perso o assente; follow o nofollow) e giudizio con i motivi. Solo i link che portano visite.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete",
              "channel_excluded",
              "domain",
              "summary",
              "items"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "channel_excluded": {
                "type": "boolean",
                "description": "Il filtro di canale esclude il referral: elenco vuoto."
              },
              "domain": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Dominio della proprietà cercato nelle pagine."
              },
              "summary": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sites",
                  "sessions",
                  "positive",
                  "neutral",
                  "review",
                  "negative"
                ],
                "properties": {
                  "sites": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "sessions": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "positive": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "neutral": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "review": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "negative": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "items": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "host",
                    "sessions",
                    "visitors",
                    "engaged_sessions",
                    "duration_ms",
                    "conversions",
                    "all_sessions",
                    "bots",
                    "suspicious",
                    "low_trust",
                    "link",
                    "origins",
                    "linked_pages",
                    "pages",
                    "verdict",
                    "reasons"
                  ],
                  "properties": {
                    "host": {
                      "type": "string",
                      "maxLength": 255,
                      "description": "Sito che linka, senza «www.»."
                    },
                    "sessions": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Visite come nella Dashboard (canale referral, robot mai mostrati esclusi)."
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "engaged_sessions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "duration_ms": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "conversions": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Conversioni confermate dal server più quelle verificate dalle regole."
                    },
                    "all_sessions": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Tutte le visite dal sito, compresi i robot mai mostrati: base di bots, suspicious e low_trust."
                    },
                    "bots": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "suspicious": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "low_trust": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "link": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "state",
                        "rel",
                        "anchor",
                        "link_url",
                        "links_out",
                        "checked_at",
                        "first_found_at",
                        "last_found_at"
                      ],
                      "properties": {
                        "state": {
                          "enum": [
                            "found",
                            "lost",
                            "missing_page",
                            "missing_home",
                            "unreachable",
                            "blocked",
                            "not_html",
                            "unchecked"
                          ],
                          "description": "found = il link c'è; lost = c'era e non c'è più; missing_page = la pagina che linka non lo contiene; missing_home = il browser ha mandato solo il dominio e il link non è in home; unreachable, blocked (robots.txt), not_html; unchecked = non ancora controllata."
                        },
                        "rel": {
                          "type": "array",
                          "items": {
                            "enum": [
                              "nofollow",
                              "sponsored",
                              "ugc"
                            ]
                          },
                          "maxItems": 3
                        },
                        "anchor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "link_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "links_out": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Link verso altri siti nella pagina."
                        },
                        "checked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "Z$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "first_found_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "Z$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_found_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "Z$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "origins": {
                      "type": "array",
                      "maxItems": 3,
                      "uniqueItems": true,
                      "items": {
                        "enum": [
                          "visits",
                          "bing",
                          "google"
                        ]
                      },
                      "description": "Da dove si sa del link: visite arrivate dal sito (fase 1), Bing Webmaster Tools, file di Google Search Console (fase 2, 28/10)."
                    },
                    "linked_pages": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Pagine del sito che linkano, secondo le visite e i motori di ricerca."
                    },
                    "pages": {
                      "type": "array",
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "url",
                          "sessions",
                          "status",
                          "checked_at",
                          "origin",
                          "anchor"
                        ],
                        "properties": {
                          "url": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "sessions": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "status": {
                            "anyOf": [
                              {
                                "enum": [
                                  "found",
                                  "missing",
                                  "unreachable",
                                  "not_html",
                                  "blocked"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "checked_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "Z$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "origin": {
                            "enum": [
                              "visits",
                              "bing",
                              "google"
                            ]
                          },
                          "anchor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 200
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Testo del link secondo il motore di ricerca, se lo dà."
                          }
                        }
                      }
                    },
                    "verdict": {
                      "enum": [
                        "positive",
                        "neutral",
                        "review",
                        "negative"
                      ]
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "converts",
                          "engaged_visitors",
                          "mostly_bots",
                          "mostly_suspicious",
                          "link_missing",
                          "link_lost",
                          "many_outbound",
                          "low_engagement",
                          "some_suspicious",
                          "too_few",
                          "link_follow",
                          "link_nofollow",
                          "link_not_in_home"
                        ]
                      },
                      "maxItems": 13
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "Search": {
        "description": "28/10: dati di ricerca dei motori collegati dall'azienda (Google Search Console dal 30/10, Bing Webmaster Tools), un motore alla volta: impressioni, clic, CTR e posizione media nel periodo e nel periodo di confronto, andamento per giorno, ricerche e pagine (per giorno con Google, settimanali con Bing: la data del motore), visite organiche da quel motore registrate da noi per pagina d'ingresso. I filtri delle visite non valgono per i dati del motore. scope site (vista di un sito o accesso solo ad alcuni siti): solo le pagine di quei siti, senza ricerche né andamento.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "engine",
              "engines",
              "scope",
              "connection",
              "coverage",
              "compare",
              "summary",
              "days",
              "queries",
              "pages",
              "sessions"
            ],
            "properties": {
              "engine": {
                "type": "string",
                "enum": [
                  "google",
                  "bing"
                ],
                "description": "Il motore di questi dati: quello chiesto (engine) o il primo collegato, Google prima di Bing."
              },
              "engines": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "google",
                    "bing"
                  ]
                },
                "uniqueItems": true,
                "description": "30/10: i motori collegati a questo dominio, Google prima di Bing."
              },
              "scope": {
                "enum": [
                  "property",
                  "site"
                ]
              },
              "connection": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "status",
                      "synced_at"
                    ],
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "ok",
                          "site_missing",
                          "revoked",
                          "error"
                        ]
                      },
                      "synced_at": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                ],
                "description": "Collegamento del dominio a Bing; null se non collegato."
              },
              "coverage": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "from",
                      "to"
                    ],
                    "properties": {
                      "from": {
                        "type": "string",
                        "format": "date"
                      },
                      "to": {
                        "type": "string",
                        "format": "date"
                      }
                    }
                  }
                ],
                "description": "Primo e ultimo giorno dei dati del motore che abbiamo."
              },
              "compare": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "from",
                      "to"
                    ],
                    "properties": {
                      "from": {
                        "type": "string",
                        "format": "date"
                      },
                      "to": {
                        "type": "string",
                        "format": "date"
                      }
                    }
                  }
                ],
                "description": "Date locali del periodo di confronto (to esclusa)."
              },
              "summary": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "current",
                  "previous"
                ],
                "properties": {
                  "current": {
                    "$ref": "#/components/schemas/SearchMetrics"
                  },
                  "previous": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/SearchMetrics"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Periodo di confronto; null senza confronto."
                  }
                }
              },
              "days": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "day",
                    "impressions",
                    "clicks"
                  ],
                  "properties": {
                    "day": {
                      "type": "string",
                      "format": "date"
                    },
                    "impressions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "clicks": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "queries": {
                "type": "array",
                "maxItems": 200,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "query",
                    "current",
                    "previous"
                  ],
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "current": {
                      "$ref": "#/components/schemas/SearchMetrics"
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/SearchMetrics"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Periodo di confronto; null senza confronto."
                    }
                  }
                }
              },
              "pages": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "url",
                    "path",
                    "current",
                    "previous",
                    "sessions"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "path": {
                      "type": "string"
                    },
                    "current": {
                      "$ref": "#/components/schemas/SearchMetrics"
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/SearchMetrics"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Periodo di confronto; null senza confronto."
                    },
                    "sessions": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Visite organiche da Bing registrate da noi con questa pagina d'ingresso nel periodo."
                    }
                  }
                }
              },
              "sessions": {
                "type": "integer",
                "minimum": 0,
                "description": "Visite organiche da Bing registrate da noi nel periodo."
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "SearchMetrics": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "impressions",
          "clicks",
          "ctr",
          "position"
        ],
        "properties": {
          "impressions": {
            "type": "integer",
            "minimum": 0
          },
          "clicks": {
            "type": "integer",
            "minimum": 0
          },
          "ctr": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Clic / impressioni; null senza impressioni."
          },
          "position": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Posizione media delle impressioni, pesata sulle impressioni; null se il motore non la dà."
          }
        }
      },
      "FraudEvidence": {
        "description": "08/10: rapporto dei clic a pagamento di una campagna per una richiesta di verifica alla piattaforma di advertising. Un clic per riga (visita arrivata da annuncio) con data e ora UTC, GCLID, IP (completo entro 7 giorni o dalle prove conservate 60 giorni per i clic con anomalie, troncato altrimenti: ip_complete; mai al Reader), rete, luogo, dispositivo, comportamento e motivi; stessi segnali del report fraud. customer_id = ID cliente Google Ads delle impostazioni del Marketing.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete",
              "campaign",
              "customer_id",
              "summary",
              "items",
              "limited"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "campaign": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 300
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "customer_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "limited": {
                "type": "boolean"
              },
              "summary": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "clicks",
                      "suspicious",
                      "by_reason",
                      "converted"
                    ],
                    "properties": {
                      "clicks": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "suspicious": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "converted": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "by_reason": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "high_risk",
                          "masked_network",
                          "bot",
                          "low_trust",
                          "instant_bounce",
                          "repeated_ip",
                          "reused_click_id"
                        ],
                        "properties": {
                          "high_risk": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "masked_network": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "bot": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "low_trust": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "instant_bounce": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "repeated_ip": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "reused_click_id": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      }
                    }
                  }
                ]
              },
              "items": {
                "type": "array",
                "maxItems": 5000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "session_id",
                    "clicked_at",
                    "gclid",
                    "campaign",
                    "keyword",
                    "ip",
                    "ip_complete",
                    "network",
                    "country",
                    "city",
                    "device",
                    "browser",
                    "os",
                    "landing_path",
                    "duration_s",
                    "pages",
                    "converted",
                    "trust_score",
                    "same_ip_clicks",
                    "same_click_id_visits",
                    "reasons"
                  ],
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "clicked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gclid": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "keyword": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ip": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 45
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ip_complete": {
                      "type": "boolean"
                    },
                    "network": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "city": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "browser": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "os": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "landing_path": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2048
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "duration_s": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "pages": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "converted": {
                      "type": "boolean"
                    },
                    "trust_score": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "same_ip_clicks": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "same_click_id_visits": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "high_risk",
                          "masked_network",
                          "bot",
                          "low_trust",
                          "instant_bounce",
                          "repeated_ip",
                          "reused_click_id"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "History": {
        "description": "#39 GDPR: storico mensile anonimo. Per ogni mese chiuso i numeri della Panoramica (stesso calcolo) per la dimensione scelta, del dominio (staging esclusi) o di un sito; ordini e ricavi per «commerce». Solo numeri, conservati anche dopo la cancellazione dei dati delle persone (retention_months). raw_data_since = primo istante con i dati delle persone ancora conservati (null = nessuna cancellazione).",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "dimension",
              "retention_months",
              "raw_data_since",
              "items"
            ],
            "properties": {
              "dimension": {
                "enum": [
                  "total",
                  "channel",
                  "source",
                  "campaign",
                  "landing",
                  "country",
                  "device",
                  "commerce"
                ]
              },
              "retention_months": {
                "type": "integer",
                "minimum": 1
              },
              "raw_data_since": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "items": {
                "type": "array",
                "maxItems": 2000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "month",
                    "key",
                    "metrics"
                  ],
                  "properties": {
                    "month": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}$"
                    },
                    "key": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 300
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metrics": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "RealtimeVisitors": {
        "description": "07/10: visitatori attivi negli ultimi 5 o 10 minuti, uno per riga dal più recente (al massimo 100): chi sono (nuovi o di ritorno), cosa guardano, da dove arrivano, dispositivo, luogo, ultima azione e, sui siti e-commerce, fase del carrello. Calcolati dagli eventi ricevuti, senza attendere l'elaborazione delle sessioni. Mai l'indirizzo IP.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total_visitors",
              "visitors"
            ],
            "properties": {
              "total_visitors": {
                "type": "integer",
                "minimum": 0
              },
              "visitors": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "visitor_id",
                    "session_id",
                    "returning",
                    "previous_sessions",
                    "started_at",
                    "last_seen_at",
                    "current",
                    "pages",
                    "events",
                    "last_action",
                    "channel",
                    "source",
                    "medium",
                    "campaign",
                    "referrer_host",
                    "device",
                    "browser",
                    "os",
                    "bot",
                    "country",
                    "city",
                    "converted",
                    "commerce",
                    "company",
                    "company_source",
                    "os_version",
                    "device_model",
                    "lat",
                    "lon"
                  ],
                  "properties": {
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Sessione già elaborata (per aprirne la scheda); null nei primi istanti."
                    },
                    "returning": {
                      "type": "boolean",
                      "description": "Ha già visitato il dominio in una sessione precedente."
                    },
                    "previous_sessions": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "started_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "last_seen_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "current": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "url",
                            "path",
                            "title"
                          ],
                          "properties": {
                            "url": {
                              "type": "string",
                              "maxLength": 2048
                            },
                            "path": {
                              "type": "string",
                              "maxLength": 2048
                            },
                            "title": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pages": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "events": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "last_action": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "name",
                            "label",
                            "at"
                          ],
                          "properties": {
                            "name": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "label": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "Z$"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "maxLength": 32
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 200
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "medium": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 200
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 200
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "referrer_host": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device": {
                      "type": "string",
                      "enum": [
                        "desktop",
                        "mobile",
                        "tablet",
                        "tv",
                        "other",
                        "unknown"
                      ]
                    },
                    "browser": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 80
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "os": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 80
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "os_version": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "device_model": {
                      "description": "08/10: modello dal client hint del browser (Chromium, con il consenso).",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bot": {
                      "type": "boolean"
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "city": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 120
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lat": {
                      "description": "08/10: latitudine della città (mappa), arrotondata a 0,01°; null per le visite anonime.",
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": -90,
                          "maximum": 90
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lon": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": -180,
                          "maximum": 180
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "converted": {
                      "type": "boolean",
                      "description": "Tentativo o conversione in questa visita."
                    },
                    "commerce": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "stage",
                            "items",
                            "value_minor",
                            "currency",
                            "products",
                            "obstacle"
                          ],
                          "properties": {
                            "stage": {
                              "type": "string",
                              "enum": [
                                "browsing",
                                "product",
                                "cart",
                                "checkout",
                                "payment",
                                "purchase"
                              ]
                            },
                            "items": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "value_minor": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "currency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Z]{3}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "products": {
                              "type": "array",
                              "maxItems": 5,
                              "items": {
                                "type": "string",
                                "maxLength": 200
                              }
                            },
                            "obstacle": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "company": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 200
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Azienda: annotata a mano, dal registro degli indirizzi o dal nome inverso (mai l'operatore di casa o mobile)."
                    },
                    "company_source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "manual",
                            "registry",
                            "rdns"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "window_minutes": {
                "type": "integer",
                "enum": [
                  5,
                  10
                ]
              },
              "as_of": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              }
            },
            "required": [
              "window_minutes",
              "as_of",
              "from",
              "processed_through",
              "demo"
            ]
          }
        }
      },
      "Marketing": {
        "description": "Punto 4 (02/10): sintesi economica del Marketing — costi inseriti a mano ripartiti sui giorni, conversioni secondo gli obiettivi, ROI, ROAS, CPA, CPC, CAC, LTV, CLV, gruppi pagamento/organico, campagne, traguardi KPI. Importi in unità minori della valuta.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete",
              "currency"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "lifespan_months": {
                "type": "integer"
              },
              "goals_configured": {
                "type": "boolean"
              },
              "totals": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sessions",
                  "clicks",
                  "conversions",
                  "paid_conversions",
                  "value",
                  "paid_value",
                  "cost",
                  "unassigned_cost",
                  "conversion_rate",
                  "cpa",
                  "cpc",
                  "roas",
                  "roi",
                  "new_customers",
                  "cac",
                  "ltv",
                  "clv",
                  "customers"
                ],
                "properties": {
                  "sessions": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clicks": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "conversions": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_conversions": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_value": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cost": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unassigned_cost": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "conversion_rate": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cpa": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cpc": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "roas": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "roi": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "new_customers": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cac": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ltv": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clv": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "customers": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "suspect_conversions": {
                    "type": "number"
                  }
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "group",
                    "sessions",
                    "conversions",
                    "value",
                    "converting",
                    "conversion_rate",
                    "value_per_session"
                  ],
                  "properties": {
                    "group": {
                      "enum": [
                        "paid",
                        "organic"
                      ]
                    },
                    "sessions": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversions": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "converting": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversion_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "value_per_session": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "campaigns": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "campaign",
                    "sessions",
                    "clicks",
                    "conversions",
                    "paid_conversions",
                    "value",
                    "paid_value",
                    "cost",
                    "cpa",
                    "cpc",
                    "roas",
                    "roi",
                    "conversion_rate"
                  ],
                  "properties": {
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sessions": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversions": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paid_conversions": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paid_value": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cost": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cpa": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cpc": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "roas": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "roi": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversion_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "missing_costs": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "other_currency_costs": {
                "type": "integer"
              },
              "previous": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "totals",
                      "groups"
                    ],
                    "properties": {
                      "totals": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "sessions",
                          "clicks",
                          "conversions",
                          "paid_conversions",
                          "value",
                          "paid_value",
                          "cost",
                          "unassigned_cost",
                          "conversion_rate",
                          "cpa",
                          "cpc",
                          "roas",
                          "roi",
                          "new_customers",
                          "cac",
                          "ltv",
                          "clv",
                          "customers"
                        ],
                        "properties": {
                          "sessions": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clicks": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "conversions": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "paid_conversions": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "paid_value": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cost": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "unassigned_cost": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "conversion_rate": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cpa": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cpc": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "roas": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "roi": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "new_customers": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cac": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ltv": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clv": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "customers": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "suspect_conversions": {
                            "type": "number"
                          }
                        }
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "group",
                            "sessions",
                            "conversions",
                            "value",
                            "converting",
                            "conversion_rate",
                            "value_per_session"
                          ],
                          "properties": {
                            "group": {
                              "enum": [
                                "paid",
                                "organic"
                              ]
                            },
                            "sessions": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "conversions": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "converting": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "conversion_rate": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "value_per_session": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              },
              "kpis": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "metric",
                    "monthly_target",
                    "target",
                    "actual",
                    "lower_is_better",
                    "progress",
                    "met"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "metric": {
                      "enum": [
                        "conversions",
                        "value",
                        "cost",
                        "sessions",
                        "conversion_rate",
                        "cpa",
                        "roas",
                        "roi",
                        "cac"
                      ]
                    },
                    "monthly_target": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "target": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "actual": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lower_is_better": {
                      "type": "boolean"
                    },
                    "progress": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "met": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "conversion_level": {
                "enum": [
                  "intent",
                  "attempt",
                  "verified",
                  "confirmed"
                ]
              },
              "include_suspect": {
                "type": "boolean"
              }
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schema_version": {
                "const": 1
              },
              "metrics_version": {
                "const": "v1"
              },
              "timezone": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "to": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "generated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "Z$"
              },
              "processed_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "Z$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "demo": {
                "type": "boolean"
              },
              "start": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "end": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "schema_version",
              "metrics_version",
              "timezone",
              "from",
              "to",
              "generated_at",
              "processed_through",
              "demo",
              "start",
              "end"
            ]
          }
        }
      },
      "MarketingConversions": {
        "description": "#30 fase 2: conversioni reali per obiettivo e livello (intenzione, tentativo, verificata, confermata), valide e sospette con i motivi, ultime conversioni. Conteggi dalla soglia di livello delle impostazioni; le sospette escluse salvo include_suspect.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "level": {
                "enum": [
                  "intent",
                  "attempt",
                  "verified",
                  "confirmed"
                ]
              },
              "min_active_ms": {
                "type": "integer"
              },
              "include_suspect": {
                "type": "boolean"
              },
              "goals_configured": {
                "type": "boolean"
              },
              "totals": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sessions",
                  "converting_sessions",
                  "conversion_rate",
                  "conversions",
                  "suspect_conversions",
                  "value_minor"
                ],
                "properties": {
                  "sessions": {
                    "type": "number"
                  },
                  "converting_sessions": {
                    "type": "number"
                  },
                  "conversion_rate": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "conversions": {
                    "type": "number"
                  },
                  "suspect_conversions": {
                    "type": "number"
                  },
                  "value_minor": {
                    "type": "number"
                  }
                }
              },
              "goals": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "value_minor",
                    "rules",
                    "levels",
                    "unverified_attempts",
                    "conversions",
                    "suspect_conversions",
                    "value_minor_total",
                    "sessions"
                  ],
                  "properties": {
                    "id": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "value_minor": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "level",
                          "type"
                        ],
                        "properties": {
                          "level": {
                            "enum": [
                              "intent",
                              "attempt",
                              "verified",
                              "confirmed"
                            ]
                          },
                          "type": {
                            "enum": [
                              "contact",
                              "form_submit",
                              "form_success",
                              "form_response",
                              "rule_attempt",
                              "rule_success",
                              "order",
                              "goal",
                              "event",
                              "page",
                              "server"
                            ]
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "kind": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "levels": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "intent",
                        "attempt",
                        "verified",
                        "confirmed"
                      ],
                      "properties": {
                        "intent": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "occurrences",
                            "sessions"
                          ],
                          "properties": {
                            "occurrences": {
                              "type": "number"
                            },
                            "sessions": {
                              "type": "number"
                            }
                          }
                        },
                        "attempt": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "occurrences",
                            "sessions"
                          ],
                          "properties": {
                            "occurrences": {
                              "type": "number"
                            },
                            "sessions": {
                              "type": "number"
                            }
                          }
                        },
                        "verified": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "occurrences",
                            "sessions"
                          ],
                          "properties": {
                            "occurrences": {
                              "type": "number"
                            },
                            "sessions": {
                              "type": "number"
                            }
                          }
                        },
                        "confirmed": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "occurrences",
                            "sessions"
                          ],
                          "properties": {
                            "occurrences": {
                              "type": "number"
                            },
                            "sessions": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "unverified_attempts": {
                      "type": "number"
                    },
                    "conversions": {
                      "type": "number"
                    },
                    "suspect_conversions": {
                      "type": "number"
                    },
                    "value_minor_total": {
                      "type": "number"
                    },
                    "sessions": {
                      "type": "number"
                    }
                  }
                }
              },
              "reasons": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bot": {
                    "type": "number"
                  },
                  "masked_network": {
                    "type": "number"
                  },
                  "high_risk": {
                    "type": "number"
                  },
                  "low_trust": {
                    "type": "number"
                  },
                  "too_fast": {
                    "type": "number"
                  },
                  "repeated_ip": {
                    "type": "number"
                  }
                }
              },
              "recent": {
                "type": "array",
                "maxItems": 50,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "session_id",
                    "at",
                    "goal",
                    "level",
                    "type",
                    "ref",
                    "sub",
                    "active_ms",
                    "conversions",
                    "value_minor",
                    "channel",
                    "source",
                    "campaign",
                    "paid",
                    "suspect",
                    "reasons",
                    "outcome"
                  ],
                  "properties": {
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "goal": {
                      "type": "string"
                    },
                    "level": {
                      "enum": [
                        "intent",
                        "attempt",
                        "verified",
                        "confirmed"
                      ]
                    },
                    "type": {
                      "enum": [
                        "contact",
                        "form_submit",
                        "form_success",
                        "form_response",
                        "rule_attempt",
                        "rule_success",
                        "order",
                        "goal",
                        "event",
                        "page",
                        "server"
                      ]
                    },
                    "ref": {
                      "type": "string"
                    },
                    "sub": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "active_ms": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "conversions": {
                      "type": "number"
                    },
                    "value_minor": {
                      "type": "number"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "campaign": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paid": {
                      "type": "boolean"
                    },
                    "suspect": {
                      "type": "boolean"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "enum": [
                          "bot",
                          "masked_network",
                          "high_risk",
                          "low_trust",
                          "too_fast",
                          "repeated_ip"
                        ]
                      }
                    },
                    "outcome": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "status",
                        "via",
                        "reason",
                        "field",
                        "http_status",
                        "page",
                        "duration_ms"
                      ],
                      "description": "Esito: riuscita (come lo sappiamo), non riuscita (perché) o esito non visto; dove (pagina dell'invio) e quanto è durata la compilazione.",
                      "properties": {
                        "status": {
                          "enum": [
                            "success",
                            "failed",
                            "unknown"
                          ]
                        },
                        "via": {
                          "anyOf": [
                            {
                              "enum": [
                                "server",
                                "order",
                                "rule",
                                "thank_you",
                                "form"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "enum": [
                                "error",
                                "invalid",
                                "response",
                                "no_signal",
                                "contact"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "field": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "http_status": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "page": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "duration_ms": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MarketingFunnel": {
        "description": "#30 fase 3: report di un funnel — viaggi (visite o visitatori), passi raggiunti, tassi, tempi tra i passi e, per chi abbandona, pagine d'uscita e successive, attenzione dopo il passo, qualità con i motivi; canali di provenienza con il tasso di passaggio.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "truncated": {
                "type": "boolean"
              },
              "definition": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "steps",
                  "scope",
                  "window_days"
                ],
                "properties": {
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type"
                      ],
                      "properties": {
                        "label": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "type": {
                          "enum": [
                            "page",
                            "contact",
                            "form_submit",
                            "form_success",
                            "form_response",
                            "rule_attempt",
                            "rule_success",
                            "order",
                            "goal",
                            "event",
                            "server",
                            "conversion"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "level": {
                          "anyOf": [
                            {
                              "enum": [
                                "intent",
                                "attempt",
                                "verified",
                                "confirmed"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "goal_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "scope": {
                    "enum": [
                      "session",
                      "visitor"
                    ]
                  },
                  "window_days": {
                    "type": "integer"
                  }
                }
              },
              "journeys": {
                "type": "number"
              },
              "entered": {
                "type": "number"
              },
              "completed": {
                "type": "number"
              },
              "completion_rate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "index",
                    "label",
                    "reached",
                    "rate_from_previous",
                    "rate_from_start",
                    "median_ms_from_previous",
                    "dropped",
                    "channels"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "label": {
                      "type": "string"
                    },
                    "reached": {
                      "type": "number"
                    },
                    "rate_from_previous": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rate_from_start": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "median_ms_from_previous": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dropped": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "count",
                            "exit_pages",
                            "next_pages",
                            "left_after_step",
                            "median_attention_after_ms",
                            "suspect",
                            "reasons"
                          ],
                          "properties": {
                            "count": {
                              "type": "number"
                            },
                            "exit_pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "key",
                                  "count"
                                ],
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "next_pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                  "key",
                                  "count"
                                ],
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "number"
                                  }
                                }
                              }
                            },
                            "left_after_step": {
                              "type": "number"
                            },
                            "median_attention_after_ms": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "suspect": {
                              "type": "number"
                            },
                            "reasons": {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "bot": {
                                  "type": "number"
                                },
                                "masked_network": {
                                  "type": "number"
                                },
                                "high_risk": {
                                  "type": "number"
                                },
                                "low_trust": {
                                  "type": "number"
                                },
                                "too_fast": {
                                  "type": "number"
                                },
                                "repeated_ip": {
                                  "type": "number"
                                }
                              }
                            }
                          }
                        }
                      ]
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "key",
                          "entered",
                          "continued",
                          "rate"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "entered": {
                            "type": "number"
                          },
                          "continued": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "rate": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MarketingDiagnosis": {
        "description": "#30 fase 4: perché si converte o no — chi converte contro chi no (attenzione, pagine, scorrimento, rimbalzi), tassi per pagina d'ingresso, dispositivo, canale e campagna con la quota sospetta, contenuti che aiutano o frenano, segnalazioni automatiche.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "level": {
                "enum": [
                  "intent",
                  "attempt",
                  "verified",
                  "confirmed"
                ]
              },
              "overall_rate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "groups": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "converted",
                  "not_converted",
                  "suspect",
                  "bots"
                ],
                "properties": {
                  "converted": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "sessions",
                      "measured",
                      "median_active_ms",
                      "median_pages",
                      "median_scroll",
                      "bounce_rate"
                    ],
                    "properties": {
                      "sessions": {
                        "type": "number"
                      },
                      "measured": {
                        "type": "number"
                      },
                      "median_active_ms": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_pages": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_scroll": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "bounce_rate": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "not_converted": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "sessions",
                      "measured",
                      "median_active_ms",
                      "median_pages",
                      "median_scroll",
                      "bounce_rate"
                    ],
                    "properties": {
                      "sessions": {
                        "type": "number"
                      },
                      "measured": {
                        "type": "number"
                      },
                      "median_active_ms": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_pages": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_scroll": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "bounce_rate": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "suspect": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "sessions",
                      "measured",
                      "median_active_ms",
                      "median_pages",
                      "median_scroll",
                      "bounce_rate"
                    ],
                    "properties": {
                      "sessions": {
                        "type": "number"
                      },
                      "measured": {
                        "type": "number"
                      },
                      "median_active_ms": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_pages": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "median_scroll": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "bounce_rate": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "bots": {
                    "type": "number"
                  }
                }
              },
              "landing": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "sessions",
                    "converted",
                    "suspect",
                    "rate",
                    "suspect_share"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "sessions": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "suspect": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "suspect_share": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "devices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "sessions",
                    "converted",
                    "suspect",
                    "rate",
                    "suspect_share"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "sessions": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "suspect": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "suspect_share": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "sessions",
                    "converted",
                    "suspect",
                    "rate",
                    "suspect_share"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "sessions": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "suspect": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "suspect_share": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "campaigns": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "sessions",
                    "converted",
                    "suspect",
                    "rate",
                    "suspect_share"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "sessions": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "suspect": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "suspect_share": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "content_helps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "viewers",
                    "converted",
                    "rate",
                    "lift"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "viewers": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lift": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "content_weak": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "viewers",
                    "converted",
                    "rate",
                    "lift"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "viewers": {
                      "type": "number"
                    },
                    "converted": {
                      "type": "number"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lift": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "insights": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "severity",
                    "data"
                  ],
                  "properties": {
                    "code": {
                      "enum": [
                        "attention_gap",
                        "device_gap",
                        "landing_weak",
                        "campaign_suspect",
                        "campaign_no_conversions",
                        "form_abandon",
                        "form_errors",
                        "unverified",
                        "form_not_conversion",
                        "no_outcome"
                      ]
                    },
                    "severity": {
                      "enum": [
                        "high",
                        "medium"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              }
            }
          }
        }
      },
      "MarketingForms": {
        "description": "#30 fase 4: moduli della coorte — inizio, invio, riuscito, campi non validi, errori, abbandoni; campi dove ci si ferma o si sbaglia; tempi di compilazione; segnalazioni.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "level": {
                "enum": [
                  "intent",
                  "attempt",
                  "verified",
                  "confirmed"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "kind",
                    "starts",
                    "submits",
                    "successes",
                    "invalid",
                    "errors",
                    "abandons",
                    "submit_rate",
                    "success_rate",
                    "abandon_rate",
                    "abandon_fields",
                    "invalid_fields",
                    "median_submit_ms",
                    "median_abandon_ms",
                    "auto_submits",
                    "responses",
                    "response_rate",
                    "excluded",
                    "non_conversion",
                    "purpose",
                    "purpose_auto",
                    "purpose_manual",
                    "category"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "starts": {
                      "type": "number"
                    },
                    "submits": {
                      "type": "number"
                    },
                    "successes": {
                      "type": "number"
                    },
                    "invalid": {
                      "type": "number"
                    },
                    "errors": {
                      "type": "number"
                    },
                    "abandons": {
                      "type": "number"
                    },
                    "submit_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "success_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "abandon_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "abandon_fields": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "key",
                          "count"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "invalid_fields": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "key",
                          "count"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "median_submit_ms": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "median_abandon_ms": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "auto_submits": {
                      "type": "number"
                    },
                    "responses": {
                      "type": "number"
                    },
                    "response_rate": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "excluded": {
                      "type": "boolean"
                    },
                    "non_conversion": {
                      "anyOf": [
                        {
                          "enum": [
                            "filter"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rules": {
                      "description": "#31: regole del registratore legate al modulo (nomi); invii ed esiti includono i loro eventi.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "purpose": {
                      "type": "string",
                      "enum": [
                        "contact",
                        "quote",
                        "order",
                        "newsletter",
                        "registration",
                        "login",
                        "search",
                        "other"
                      ],
                      "description": "07/10: scopo del modulo (scelto a mano o proposto da Analytics)."
                    },
                    "purpose_auto": {
                      "type": "string",
                      "enum": [
                        "contact",
                        "quote",
                        "order",
                        "newsletter",
                        "registration",
                        "login",
                        "search",
                        "other"
                      ]
                    },
                    "purpose_manual": {
                      "type": "boolean"
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "conversion",
                        "micro",
                        "usage"
                      ],
                      "description": "conversion: contatto, preventivo, ordine; micro: newsletter, registrazione; usage: accesso, ricerca, altro."
                    }
                  }
                }
              },
              "insights": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "severity",
                    "data"
                  ],
                  "properties": {
                    "code": {
                      "enum": [
                        "attention_gap",
                        "device_gap",
                        "landing_weak",
                        "campaign_suspect",
                        "campaign_no_conversions",
                        "form_abandon",
                        "form_errors",
                        "unverified",
                        "form_not_conversion",
                        "no_outcome"
                      ]
                    },
                    "severity": {
                      "enum": [
                        "high",
                        "medium"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              }
            }
          }
        }
      },
      "MarketingAttribution": {
        "description": "#30 fase 4: attribuzione delle conversioni valide tra le visite dello stesso visitatore nei 30 giorni prima: prima visita, ultima, ultima non diretta, lineare; per canale, sorgente o campagna.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "complete"
            ],
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "level": {
                "enum": [
                  "intent",
                  "attempt",
                  "verified",
                  "confirmed"
                ]
              },
              "by": {
                "enum": [
                  "channel",
                  "source",
                  "campaign"
                ]
              },
              "lookback_days": {
                "type": "integer"
              },
              "conversions": {
                "type": "number"
              },
              "median_sessions_to_convert": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "median_days_to_convert": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "single_visit_share": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "first",
                    "last",
                    "last_non_direct",
                    "linear",
                    "first_value",
                    "last_value",
                    "last_non_direct_value",
                    "linear_value"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "first": {
                      "type": "number"
                    },
                    "last": {
                      "type": "number"
                    },
                    "last_non_direct": {
                      "type": "number"
                    },
                    "linear": {
                      "type": "number"
                    },
                    "first_value": {
                      "type": "number"
                    },
                    "last_value": {
                      "type": "number"
                    },
                    "last_non_direct_value": {
                      "type": "number"
                    },
                    "linear_value": {
                      "type": "number"
                    }
                  }
                }
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "code",
              "message",
              "request_id"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "CollectionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "rejected": {
            "type": "array",
            "maxItems": 20,
            "description": "Eventi scartati uno per uno (16/10): gli altri del lotto sono salvati. Assente se nessuno.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "event_id",
                "reason"
              ],
              "properties": {
                "event_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reason": {
                  "enum": [
                    "invalid_event",
                    "invalid_timestamp",
                    "invalid_engagement",
                    "invalid_url",
                    "event_id_conflict"
                  ]
                }
              }
            }
          },
          "verification": {
            "type": "boolean",
            "description": "Invio di un link di verifica del master (#39): raccolto fuori dai dati del cliente."
          }
        },
        "required": [
          "accepted",
          "duplicates",
          "request_id"
        ]
      },
      "ConfirmationReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "confirmation_id": {
            "type": "string",
            "format": "uuid"
          },
          "duplicate": {
            "type": "boolean"
          },
          "attributed": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "confirmation_id",
          "duplicate",
          "attributed",
          "request_id"
        ]
      },
      "Collect": {
        "title": "Browser collection v1 — draft for review",
        "type": "object",
        "properties": {
          "schema_version": {
            "const": 1
          },
          "property_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^pk_[a-zA-Z0-9_-]+$"
          },
          "consent": {
            "description": "#39 GDPR: consenso dichiarato dal banner del sito con kai(\"consent\", …). level 0 = solo tecnici (il server rende anonimo il visitatore e tronca l'IP), 1 = statistiche, 2 = statistiche e registrazione della visita. Assente: consenso non richiesto, oppure livello 0 se il dominio chiede il consenso.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "level"
            ],
            "properties": {
              "level": {
                "enum": [
                  0,
                  1,
                  2
                ]
              },
              "categories": {
                "type": "object",
                "maxProperties": 12,
                "propertyNames": {
                  "pattern": "^[a-z][a-z0-9_]{0,31}$"
                },
                "additionalProperties": {
                  "type": "boolean"
                }
              }
            }
          },
          "verify": {
            "description": "#39: codice di un link di verifica del master (#kai_check=…). Valido: gli invii restano fuori dai dati del cliente, visibili solo nella console master con il consenso del banner e ciò che Analytics avrebbe applicato. Non valido: ignorato.",
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "user": {
            "description": "20/10, identità tra dispositivi: impronta SHA-256 (64 caratteri esadecimali) dell'identificativo che il sito ha dichiarato con kai(\"identify\", id), mai il dato in chiaro. Il server la cifra con la chiave del dominio e unisce le visite dei browser con la stessa persona. Ignorata con il livello di consenso 0 e se non è un'impronta valida.",
            "type": "string",
            "maxLength": 64
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 256
                        },
                        "not_found": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "product": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "referrer_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https?://",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attribution_sanitized": {
                          "type": "boolean",
                          "description": "Client-reported sanitization diagnostic, not trusted evidence of attribution or conversion."
                        },
                        "screen": {
                          "type": "object",
                          "description": "Schermo del dispositivo in px CSS (punto 1, 02/10): risoluzione nella scheda e segnale di affidabilità.",
                          "properties": {
                            "width": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 20000
                            },
                            "height": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 20000
                            },
                            "pixel_ratio": {
                              "type": "number",
                              "minimum": 0.25,
                              "maximum": 10
                            },
                            "touch": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 32,
                              "description": "Punti di contatto dello schermo (navigator.maxTouchPoints): iPad che si presenta come Mac, tablet e telefoni."
                            },
                            "model": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[A-Za-z0-9 ._()+-]+$",
                              "description": "Modello dal browser (client hint, solo con il consenso alle statistiche)."
                            },
                            "platform_version": {
                              "type": "string",
                              "pattern": "^[0-9]{1,4}(\\.[0-9]{1,4}){0,3}$",
                              "description": "Versione del sistema dal browser (client hint): distingue Windows 11 da 10, versione di macOS."
                            }
                          },
                          "required": [
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [],
                      "additionalProperties": false
                    },
                    "type": {
                      "const": "page_view"
                    },
                    "data": {
                      "type": "object",
                      "properties": {},
                      "required": [],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event_id",
                    "visitor_id",
                    "session_id",
                    "occurred_at",
                    "page",
                    "type",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 256
                        },
                        "not_found": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "product": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "referrer_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https?://",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attribution_sanitized": {
                          "type": "boolean",
                          "description": "Client-reported sanitization diagnostic, not trusted evidence of attribution or conversion."
                        }
                      },
                      "required": [],
                      "additionalProperties": false
                    },
                    "type": {
                      "const": "engagement"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "page_view_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "active_ms": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 60000
                        },
                        "scroll_percent": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "visible_ms": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 60000
                        }
                      },
                      "required": [
                        "page_view_id",
                        "active_ms",
                        "scroll_percent",
                        "visible_ms"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event_id",
                    "visitor_id",
                    "session_id",
                    "occurred_at",
                    "page",
                    "type",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 256
                        },
                        "not_found": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "product": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "referrer_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https?://",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attribution_sanitized": {
                          "type": "boolean",
                          "description": "Client-reported sanitization diagnostic, not trusted evidence of attribution or conversion."
                        }
                      },
                      "required": [],
                      "additionalProperties": false
                    },
                    "type": {
                      "const": "event"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$"
                        },
                        "level": {
                          "enum": [
                            "info",
                            "warning",
                            "error"
                          ]
                        },
                        "target_url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "contact": {
                          "type": "object",
                          "description": "#30: link di contatto cliccato (contact_click). Recapito del sito, non del visitatore.",
                          "properties": {
                            "kind": {
                              "enum": [
                                "email",
                                "phone",
                                "whatsapp"
                              ]
                            },
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 254,
                              "pattern": "^(chat|\\+?[0-9]{3,20}|[^\\s@]{1,64}@[^\\s@]+\\.[^\\s@]{2,})$"
                            }
                          },
                          "required": [
                            "kind",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        "form": {
                          "type": "object",
                          "description": "#30: ciclo di vita di un modulo (form_start, form_submit, form_invalid, form_error, form_abandon, form_success). Solo nomi tecnici, mai valori. form_auto_submit = invio senza campi toccati; form_response = risposta 2xx all'invio in background (esito probabile), con status.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$"
                            },
                            "kind": {
                              "enum": [
                                "generic",
                                "cf7",
                                "gravity",
                                "wpforms",
                                "elementor",
                                "hubspot",
                                "woocommerce",
                                "search",
                                "login",
                                "filter"
                              ]
                            },
                            "fields": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 500
                            },
                            "field": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$"
                            },
                            "errors": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 500
                            },
                            "duration_ms": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            "status": {
                              "type": "integer",
                              "minimum": 100,
                              "maximum": 599
                            },
                            "shape": {
                              "type": "string",
                              "description": "07/10: forma del modulo per riconoscerne lo scopo: una lettera per campo (e email, p password, t telefono, s ricerca, f file, m messaggio), in ordine, es. «eemt». Mai valori.",
                              "pattern": "^[a-z0-9]{0,32}$"
                            }
                          },
                          "required": [
                            "id",
                            "kind"
                          ],
                          "additionalProperties": false
                        },
                        "rule": {
                          "type": "object",
                          "description": "#31: regola del dominio scattata (rule_attempt, rule_success, rule_presumed): id della regola, invio che lega tentativo ed esito, pagina d'arrivo per gli esiti presunti, lingua della pagina.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "submission": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{32}$"
                            },
                            "destination": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 300
                            },
                            "lang": {
                              "type": "string",
                              "description": "Lingua dichiarata dalla pagina (<html lang>), per le statistiche per lingua.",
                              "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8}){0,2}$"
                            }
                          },
                          "required": [
                            "id",
                            "submission"
                          ],
                          "additionalProperties": false
                        },
                        "commerce": {
                          "type": "object",
                          "description": "E-commerce (06/10): view_item, add_to_cart, remove_from_cart, begin_checkout, purchase. Importi in unità della valuta (12.9 = 12,90 €), come GA4. Mai dati del cliente o di pagamento. Analisi del percorso: step (passo del checkout), reason (ostacolo o errore), method (pagamento o consegna), customer (business/consumer), threshold (soglia della spedizione gratuita), list (lista di provenienza).",
                          "additionalProperties": false,
                          "properties": {
                            "order_id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            },
                            "value": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1000000000000
                            },
                            "tax": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1000000000000
                            },
                            "shipping": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1000000000000
                            },
                            "discount": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1000000000000
                            },
                            "coupon": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "store": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "items": {
                              "type": "array",
                              "maxItems": 50,
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "category": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 120
                                  },
                                  "brand": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 120
                                  },
                                  "variant": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 120
                                  },
                                  "price": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1000000000000
                                  },
                                  "quantity": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100000
                                  }
                                },
                                "minProperties": 1
                              }
                            },
                            "step": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 32
                            },
                            "reason": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "method": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 32
                            },
                            "customer": {
                              "enum": [
                                "business",
                                "consumer"
                              ]
                            },
                            "threshold": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1000000000000
                            },
                            "list": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            }
                          }
                        }
                      },
                      "required": [
                        "name",
                        "level"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event_id",
                    "visitor_id",
                    "session_id",
                    "occurred_at",
                    "page",
                    "type",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 256
                        },
                        "not_found": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "product": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "referrer_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https?://",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attribution_sanitized": {
                          "type": "boolean",
                          "description": "Client-reported sanitization diagnostic, not trusted evidence of attribution or conversion."
                        }
                      },
                      "required": [],
                      "additionalProperties": false
                    },
                    "type": {
                      "const": "conversion_attempt"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "goal_key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$"
                        }
                      },
                      "required": [
                        "goal_key"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event_id",
                    "visitor_id",
                    "session_id",
                    "occurred_at",
                    "page",
                    "type",
                    "data"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "event_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "visitor_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "session_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "occurred_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "Z$"
                    },
                    "page": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://",
                          "maxLength": 2048
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 256
                        },
                        "not_found": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "product": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "referrer_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri",
                              "pattern": "^https?://",
                              "maxLength": 2048
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "attribution_sanitized": {
                          "type": "boolean",
                          "description": "Client-reported sanitization diagnostic, not trusted evidence of attribution or conversion."
                        }
                      },
                      "required": [],
                      "additionalProperties": false
                    },
                    "type": {
                      "const": "page_timing"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "page_view_id",
                        "ttfb_ms",
                        "dom_content_loaded_ms",
                        "load_ms"
                      ],
                      "properties": {
                        "page_view_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "ttfb_ms": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "dom_content_loaded_ms": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "load_ms": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lcp_ms": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "inp_ms": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 86400000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cls": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "required": [
                    "event_id",
                    "visitor_id",
                    "session_id",
                    "occurred_at",
                    "page",
                    "type",
                    "data"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "schema_version",
          "property_key",
          "events"
        ],
        "additionalProperties": false
      },
      "Confirm": {
        "title": "Server conversion confirmation v1 — draft for review",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "confirmation_id",
          "goal_key",
          "occurred_at",
          "value_minor",
          "currency"
        ],
        "properties": {
          "confirmation_id": {
            "type": "string",
            "format": "uuid"
          },
          "goal_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "visitor_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "external_reference": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "value_minor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "oneOf": [
          {
            "properties": {
              "value_minor": {
                "type": "null"
              },
              "currency": {
                "type": "null"
              }
            }
          },
          {
            "properties": {
              "value_minor": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            }
          }
        ]
      }
    }
  }
}
