{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aspern-org/json-schema/aspern-org-watch-request-schema.json",
  "title": "WatchRequest",
  "description": "Arm an alert or change its threshold. Changing a threshold re-arms it, so the next crossing fires.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aspern-org-alerts-api-openapi.yml#/components/schemas/WatchRequest",
  "type": "object",
  "required": [
    "kind",
    "target",
    "threshold"
  ],
  "properties": {
    "kind": {
      "enum": [
        "endpoint",
        "crowding",
        "consistency",
        "drawdown",
        "version",
        "proximity",
        "withdrawable",
        "shortfall",
        "idle",
        "closed",
        "control",
        "health",
        "unresolved",
        "rests"
      ],
      "description": "What to watch. Every kind the evaluator computes is listed here and no others."
    },
    "target": {
      "type": "string",
      "description": "What the kind is about, which is not always a vault. An instrument for `crowding`, an ADDRESS for `health`, `rests` and `endpoint`, an operator with its own prefix for `closed`, and a vault slug for the rest. This said \"an instrument for crowding, otherwise a vault slug\" while three kinds already took an address, so a caller arming one of those was told to send the wrong thing."
    },
    "threshold": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 3650,
      "description": "MOST KINDS TAKE A FRACTION, NOT A PERCENTAGE: 0.9 means 90%, and accepting both would make 0.9 ambiguous. One kind, `unresolved`, is measured in DAYS and takes 1 to 3650. A value outside its own kind's range is refused with a 422 naming the unit.",
      "x-unit": "decimal-fraction, except `unresolved` which is days"
    }
  }
}