{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/winnr-app/json-schema/winnr-app-webhook-schema.json",
  "title": "Webhook",
  "description": "A webhook endpoint. Winnr POSTs signed event notifications to `url`\nfor every subscribed event type. Maximum 10 endpoints per account.\n",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/winnr-app-openapi.yaml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhook endpoint ID"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Destination URL. Must be HTTPS."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional human-readable label (max 200 chars)"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Subscribed event types, or `[\"*\"]` for all events. `\"*\"` cannot be\ncombined with specific events. Valid types: `message.relayed`,\n`email.received`, `email.bounced`, `email.complained`,\n`domain.created`, `domain.ready`, `domain.dns_failed`,\n`email_user.created`, `email_user.deleted`. (`test.ping` is always\ndeliverable regardless of subscription.)\n"
    },
    "status": {
      "type": "string",
      "enum": [
        "enabled",
        "disabled",
        "auto_disabled"
      ],
      "description": "`auto_disabled` is set by Winnr after 25 consecutive failed\nevents. Set `enabled` via PATCH to resume deliveries (this also\nresets `consecutive_failures`).\n"
    },
    "disabled_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why the endpoint was auto-disabled (null otherwise)"
    },
    "secret_hint": {
      "type": "string",
      "description": "Last few characters of the signing secret, for display"
    },
    "api_version": {
      "type": "string",
      "description": "Event payload version delivered to this endpoint"
    },
    "consecutive_failures": {
      "type": "integer",
      "description": "Consecutive failed events (resets to 0 on success or re-enable)"
    },
    "last_delivery_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the most recent delivery attempt finished"
    },
    "last_delivery_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Outcome of the most recent delivery attempt"
    },
    "last_success_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When a delivery last succeeded"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}