{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/statoss-com/json-schema/statoss-com-alert-rule-schema.json",
  "title": "AlertRule",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/statoss-com-openapi.json#/components/schemas/AlertRule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The rule id."
    },
    "appId": {
      "type": "string",
      "description": "The app it watches."
    },
    "name": {
      "type": "string",
      "description": "The rule's name, up to 80 characters."
    },
    "pageId": {
      "type": "string",
      "description": "The page whose on-call takes its alerts: a status page, or the app's project's on-call page. A new rule takes the app's page unless given, else the key's, else its project's on-call, made with the first rule when the project has no status page."
    },
    "enabled": {
      "type": "boolean",
      "description": "Off keeps the rule without alerting."
    },
    "onNew": {
      "type": "boolean",
      "description": "Alerts on a new issue."
    },
    "onRegressed": {
      "type": "boolean",
      "description": "Alerts on a regression."
    },
    "onEscalating": {
      "type": "boolean",
      "description": "Alerts when an issue escalates: an hour with at least 50 events and ten times its hourly average over the week before."
    },
    "eventCount": {
      "type": "integer",
      "description": "Alerts when an issue takes so many events in eventMinutes; 0 is off.",
      "minimum": 0,
      "maximum": 1000000
    },
    "eventMinutes": {
      "type": "integer",
      "description": "The minutes eventCount is counted over.",
      "enum": [
        1,
        5,
        15,
        60,
        1440
      ]
    },
    "minPriority": {
      "type": "string",
      "description": "The issue's priority at least this; low takes any.",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "minLevel": {
      "type": [
        "string",
        "null"
      ],
      "description": "The event's level at least this; null for any.",
      "enum": [
        "debug",
        "info",
        "warning",
        "error",
        "fatal"
      ]
    },
    "environments": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Up to 10 environments an event must be in; empty for any."
    },
    "release": {
      "type": [
        "string",
        "null"
      ],
      "description": "The release an event must name; ending in * matches the start. Null for any."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The tag."
          },
          "value": {
            "type": "string",
            "description": "Its value."
          }
        }
      },
      "description": "Up to 5 tags an event must all have. Also taken as an object of key and value."
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Up to 20 category keys, one of which the issue's category reads as through the app's schema; empty for any."
    },
    "throttle": {
      "type": "string",
      "description": "How often one issue may alert: release (once per release and once per regression, once a day without a release), or at most every 30, 60, 1440 or 10080 minutes.",
      "enum": [
        "release",
        "30",
        "60",
        "1440",
        "10080"
      ]
    },
    "ownRouting": {
      "type": "boolean",
      "description": "true sends to destinationIds and memberIds; false to where the page's alerts go."
    },
    "repeatMinutes": {
      "type": "integer",
      "description": "Minutes between repeats while triggered; 0 for none.",
      "enum": [
        0,
        1,
        2,
        5,
        10,
        15,
        30,
        60
      ]
    },
    "groupMinutes": {
      "type": "integer",
      "description": "Minutes in which later alerts join the first; 0 is off.",
      "enum": [
        0,
        2,
        5,
        10,
        30
      ]
    },
    "destinationIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "With ownRouting: the team's alert destinations."
    },
    "memberIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "With ownRouting: people in the team to notify."
    },
    "paging": {
      "type": "string",
      "description": "Who is paged: \"page\" (the page's escalation policy), \"none\", or the id of one of the team's policies. Escalation is on Pro; elsewhere it is kept as it was."
    },
    "internal": {
      "type": "boolean",
      "description": "true when pageId is the project's on-call page, which is no status page."
    },
    "summary": {
      "type": "string",
      "description": "What it alerts on and how often, in words."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO 8601, UTC.",
      "format": "date-time"
    },
    "lastFiredAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601, UTC.",
      "format": "date-time"
    }
  }
}