{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldrig-dev/json-schema/coldrig-dev-webhook-create-input-schema.json",
  "title": "WebhookCreateInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coldrig-dev-webhooks-api-openapi.yml#/components/schemas/WebhookCreateInput",
  "type": "object",
  "required": [
    "url",
    "eventTypes"
  ],
  "properties": {
    "url": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048,
      "description": "HTTPS endpoint that receives event POSTs. Must be https and resolve to a public host — private/link-local/metadata IPs are rejected.\n"
    },
    "eventTypes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 4,
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      },
      "description": "Which event types to receive. At least one."
    },
    "secret": {
      "type": "string",
      "minLength": 16,
      "maxLength": 200,
      "description": "Optional HMAC signing secret (>=16 chars). Omit to have the server generate one, returned once on create.\n"
    },
    "active": {
      "type": "boolean",
      "default": true,
      "description": "Whether the subscription delivers immediately. Defaults to true."
    }
  },
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "reply",
        "bounce",
        "soft_bounce",
        "complaint",
        "unsubscribe"
      ],
      "description": "reply = genuine reply; bounce = HARD (permanent) bounce; soft_bounce = transient bounce; complaint = spam complaint; unsubscribe = typed unsubscribe-link click."
    }
  }
}