{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postlake-dev/json-schema/postlake-dev-webhook-endpoint-schema.json",
  "title": "WebhookEndpoint",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postlake-dev-webhooks-api-openapi.yml#/components/schemas/WebhookEndpoint",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "secret": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "url",
    "secret",
    "events",
    "createdAt"
  ],
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "post.approved",
        "post.rejected",
        "post.published",
        "post.failed",
        "post.partial",
        "post.processing",
        "account.connected",
        "account.disconnected",
        "message.received",
        "comment.received",
        "mention.received",
        "webhook.test"
      ],
      "description": "Which events an endpoint wants. `message.received` currently fires for Facebook and Instagram, where Meta pushes new messages to PostLake. Its payload carries `replyBy`, the moment Meta stops accepting a normal reply. Poll list conversations for inbox-capable networks that do not provide PostLake with inbound message webhooks."
    }
  }
}