{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/zespan/main/json-schema/zespan-post-webhooks-zespan-request-schema.json",
  "title": "PostWebhooksZespanRequest",
  "x-generated": "2026-10-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_ae-authored/zespan-openapi-generated.yml#/components/schemas/PostWebhooksZespanRequest",
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Always \"alert.fired\" for alert webhooks."
    },
    "alert_id": {
      "type": "string",
      "description": "The ID of the alert rule that triggered."
    },
    "rule_name": {
      "type": "string",
      "description": "The human‑readable name of the alert rule, as set in the dashboard."
    },
    "metric": {
      "type": "string",
      "description": "The metric that crossed the threshold: error_rate, cost_usd, latency_ms, request_count, or token_count."
    },
    "condition": {
      "type": "string",
      "description": "The comparison that triggered: \">\" or \"<\"."
    },
    "threshold": {
      "type": "number",
      "description": "The configured threshold value."
    },
    "current_value": {
      "type": "number",
      "description": "The actual metric value at the time of firing."
    },
    "window_min": {
      "type": "number",
      "description": "The aggregation window in minutes."
    },
    "fired_at": {
      "type": "string",
      "description": "ISO 8601 UTC timestamp when the alert fired."
    },
    "dashboard_url": {
      "type": "string",
      "description": "Direct link to the traces page for this project."
    },
    "signature": {
      "type": "string",
      "description": "HMAC‑SHA256 signature for verifying the payload."
    }
  },
  "required": [
    "event",
    "alert_id",
    "rule_name",
    "metric",
    "condition",
    "threshold",
    "current_value",
    "window_min",
    "fired_at",
    "dashboard_url",
    "signature"
  ]
}