{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-owner-notification-row-schema.json",
  "title": "OwnerNotificationRow",
  "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/OwnerNotificationRow",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "recipient_email": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "digest",
        "lifecycle_event",
        "threshold_alert",
        "missing_verified_recipient"
      ]
    },
    "event_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "webhook",
        "skipped",
        "telegram"
      ],
      "description": "telegram (notification-channel-routing-telegram, v1.126): every Telegram delivery attempt (queue-fed platform pass or the app-lane outbox tail) audits here alongside email/webhook."
    },
    "delivery_status": {
      "type": "string",
      "enum": [
        "delivered",
        "failed_transient",
        "failed_permanent",
        "skipped_no_recipient",
        "skipped_disabled",
        "deferred"
      ],
      "description": "deferred (v1.126): a Telegram send that overflowed its per-chat/global rate budget and was pushed to the next ~60s tick — never silently dropped."
    },
    "delivery_error": {
      "type": [
        "string",
        "null"
      ]
    },
    "subject": {
      "type": "object",
      "description": "notification-render-context: the project identity as it was RESOLVED at delivery time and shown in the message. Present only for project-scoped notifications whose subject resolved; individual fields are omitted (never empty) when unresolved. Rows written before this shipped have no subject key. Not part of the signed webhook envelope.",
      "properties": {
        "project_id": {
          "type": "string"
        },
        "project_name": {
          "type": "string"
        },
        "org_id": {
          "type": "string",
          "format": "uuid"
        },
        "organization_display_name": {
          "type": "string"
        },
        "serving_host": {
          "type": "string",
          "description": "Bound active custom domain if any, else the managed <subdomain>.run402.com host."
        }
      }
    },
    "attempt_count": {
      "type": "integer"
    },
    "is_test": {
      "type": "boolean"
    },
    "related_project_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "related_org_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "related_wallet_address": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "redacted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "payload": {
      "type": [
        "object",
        "null"
      ],
      "description": "null when row has been redacted past its retention window"
    }
  }
}