{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldrig-dev/json-schema/coldrig-dev-webhook-update-response-schema.json",
  "title": "WebhookUpdateResponse",
  "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/WebhookUpdateResponse",
  "allOf": [
    {
      "$ref": "#/$defs/WebhookSummary"
    },
    {
      "type": "object",
      "properties": {
        "secret": {
          "type": "string",
          "description": "Present only when this update rotated the secret; shown once."
        }
      }
    }
  ],
  "$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."
    },
    "WebhookSummary": {
      "type": "object",
      "required": [
        "id",
        "url",
        "eventTypes",
        "active",
        "status",
        "disabledReason",
        "consecutiveFailures",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "eventTypes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WebhookEventType"
          }
        },
        "active": {
          "type": "boolean"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "disabled"
          ]
        },
        "disabledReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "consecutiveFailures": {
          "type": "integer"
        },
        "createdAt": {
          "type": "integer"
        },
        "updatedAt": {
          "type": "integer"
        }
      }
    }
  }
}