{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/argus-town/json-schema/argus-town-alert-rule-schema.json",
  "title": "AlertRule",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/argus-town-alerts-api-openapi.yml#/components/schemas/AlertRule",
  "type": "object",
  "required": [
    "object",
    "id",
    "type",
    "threshold",
    "connections",
    "enabled",
    "channel",
    "last_fired_at",
    "created_at"
  ],
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "alert_rule"
      ]
    },
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "threshold": {
      "type": "number"
    },
    "connections": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Connection ids the rule watches; `null` means every connection."
    },
    "enabled": {
      "type": "boolean"
    },
    "channel": {
      "type": "string",
      "enum": [
        "email"
      ]
    },
    "last_fired_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}