{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/weatherai-io/json-schema/weatherai-io-alert-schema.json",
  "title": "Alert",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/weatherai-io-api-openapi.json#/components/schemas/Alert",
  "allOf": [
    {
      "$ref": "#/$defs/AlertInput"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "place": {
          "type": "string"
        },
        "webhook_secret": {
          "type": "string",
          "description": "Full value only in the response to POST /v1/alerts"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused"
          ]
        },
        "pause_reason": {
          "type": "string"
        },
        "next_check": {
          "type": "string",
          "format": "date-time"
        },
        "last_checked": {
          "type": "string",
          "format": "date-time"
        },
        "last_notified": {
          "type": "string",
          "format": "date-time"
        },
        "notifications_sent": {
          "type": "integer"
        },
        "outlook": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "go": {
                "type": "boolean"
              },
              "verdict": {
                "type": "string"
              },
              "score": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "AlertInput": {
      "type": "object",
      "required": [
        "name",
        "location"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 80
        },
        "location": {
          "type": "string"
        },
        "activity": {
          "type": "string",
          "enum": [
            "running",
            "cycling",
            "outdoor-event",
            "beach",
            "laundry-drying",
            "stargazing",
            "hiking",
            "golf",
            "tennis",
            "dog-walking",
            "gardening",
            "fishing",
            "sailing",
            "drone-flying",
            "exterior-painting",
            "concrete-pour",
            "roofing",
            "crop-spraying",
            "outdoor-work",
            "driving",
            "solar-pv",
            "crane-lifting",
            "groundworks",
            "marquee",
            "outdoor-dining",
            "harvesting",
            "irrigation",
            "high-sided-vehicles",
            "field-service",
            "wind-power"
          ]
        },
        "profile": {
          "type": "string",
          "description": "prf_... instead of activity"
        },
        "days_ahead": {
          "type": "integer",
          "minimum": 1,
          "maximum": 7,
          "default": 2
        },
        "notify_when": {
          "type": "string",
          "enum": [
            "change",
            "becomes_go",
            "becomes_no_go"
          ],
          "default": "change"
        },
        "interval_hours": {
          "type": "integer",
          "enum": [
            1,
            3,
            6,
            12
          ],
          "default": 3
        },
        "email": {
          "type": "boolean",
          "default": true
        },
        "webhook_url": {
          "type": "string",
          "format": "uri",
          "description": "https only"
        }
      }
    }
  }
}