{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-notification-preferences-schema.json",
  "title": "NotificationPreferences",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-agent-api-openapi.yml#/components/schemas/NotificationPreferences",
  "type": "object",
  "properties": {
    "channels": {
      "type": "object",
      "properties": {
        "email": {
          "type": "boolean"
        },
        "webhook": {
          "type": "boolean"
        }
      }
    },
    "webhook_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "webhook_signing_secret_configured": {
      "type": "boolean",
      "description": "True if a secret exists. Plaintext is returned only by POST /agent/v1/webhook-secret/rotate, never read back."
    },
    "digest_cadence": {
      "type": "string",
      "enum": [
        "off",
        "daily",
        "weekly",
        "monthly"
      ],
      "default": "weekly"
    },
    "digest_day_of_week": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7,
      "default": 1,
      "description": "1=Mon..7=Sun"
    },
    "digest_hour_utc": {
      "type": "integer",
      "minimum": 0,
      "maximum": 23,
      "default": 9
    },
    "threshold_alerts": {
      "type": "string",
      "enum": [
        "off",
        "digest_only",
        "immediate"
      ],
      "default": "digest_only"
    },
    "lifecycle_events": {
      "type": "string",
      "enum": [
        "off",
        "critical_only",
        "all"
      ],
      "default": "all"
    },
    "security_events": {
      "type": "string",
      "enum": [
        "always"
      ],
      "description": "Schema-enforced. Mandatory class — cannot be silenced."
    },
    "locale": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    }
  }
}