{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-webhook-response-schema.json",
  "title": "WebhookResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-webhooks-api-openapi.yml#/components/schemas/WebhookResponse",
  "type": "object",
  "required": [
    "webhook"
  ],
  "properties": {
    "webhook": {
      "$ref": "#/$defs/WebhookEndpoint"
    }
  },
  "$defs": {
    "WebhookEndpoint": {
      "type": "object",
      "required": [
        "id",
        "url",
        "events",
        "enabled",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WebhookEventType"
          }
        },
        "enabled": {
          "type": "boolean"
        },
        "tenants": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The tenants (`external_id`) whose email events this endpoint receives. Present only on endpoints with a tenant filter.\n"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "email.received",
        "email.sent",
        "email.delivered",
        "email.delivery_delayed",
        "email.held",
        "email.bounced",
        "email.complained",
        "email.opened",
        "email.clicked",
        "email.failed",
        "email.suppressed",
        "email.scheduled",
        "contact.unsubscribed",
        "automation.started",
        "automation.step_completed",
        "automation.completed",
        "automation.failed"
      ]
    }
  }
}