{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailinapp-com/json-schema/mailinapp-com-webhook-subscription-schema.json",
  "title": "WebhookSubscription",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailinapp-com-openapi.json#/components/schemas/WebhookSubscription",
  "type": "object",
  "required": [
    "id",
    "url",
    "events",
    "createdVia",
    "status",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "apiKeyId": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      }
    },
    "createdVia": {
      "type": "string",
      "enum": [
        "dashboard",
        "api",
        "zapier",
        "n8n"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "disabledReason": {
      "type": "string",
      "enum": [
        "gone",
        "api-key-revoked"
      ]
    },
    "createdAt": {
      "type": "integer"
    },
    "lastDeliveryAt": {
      "type": "integer"
    },
    "lastFailureAt": {
      "type": "integer"
    },
    "lastError": {
      "type": "string"
    }
  },
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "interaction.received",
        "form.submitted",
        "contact.created",
        "contact.updated",
        "lead.hot",
        "lead.new",
        "booking.created",
        "booking.cancelled",
        "deal.created",
        "deal.stage_changed",
        "purchase.completed",
        "journey.completed",
        "experiment.decided",
        "experiment.completed",
        "response.completed",
        "review.submitted"
      ]
    }
  }
}