{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bodyspec/json-schema/bodyspec-webhook-create-request-schema.json",
  "title": "WebhookCreateRequest",
  "description": "Request model for creating a webhook.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bodyspec-partner-webhooks-api-openapi.yml#/components/schemas/WebhookCreateRequest",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2083,
      "minLength": 1,
      "format": "uri",
      "title": "Url",
      "description": "HTTPS URL to receive webhook events"
    },
    "event_type": {
      "$ref": "#/$defs/WebhookEventType",
      "description": "Event type to subscribe to"
    },
    "secret": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 256,
          "minLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret",
      "description": "Optional secret for webhook authentication. BodySpec base64-encodes this value and sends it as a Bearer token in the Authorization header of every webhook delivery — i.e. `Authorization: Bearer <base64(secret)>` (standard base64, with padding)."
    },
    "enabled": {
      "type": "boolean",
      "title": "Enabled",
      "description": "Whether the webhook is enabled",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "url",
    "event_type"
  ],
  "x-internal": true,
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "results_ready",
        "reservation_created",
        "reservation_canceled",
        "reservation_no_show"
      ],
      "title": "WebhookEventType",
      "description": "Supported webhook event types.",
      "x-internal": true
    }
  }
}