{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/argus-town/json-schema/argus-town-alert-rule-create-body-schema.json",
  "title": "AlertRuleCreateBody",
  "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/AlertRuleCreateBody",
  "type": "object",
  "required": [
    "type",
    "threshold"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "low_balance",
        "days_to_zero",
        "spend_spike",
        "projected_overage",
        "rate_limit_headroom",
        "error_rate",
        "cost_drift"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "USD, days or percent, depending on `type`.",
      "title": "between(0, 1000000000000)",
      "minimum": 0,
      "maximum": 1000000000000
    },
    "connections": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Connection ids the rule watches. Omit to watch every connection. An unknown id is an error.",
      "title": "maxItems(50)",
      "minItems": 1,
      "maxItems": 50
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}