{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-webhook-subscription-update-schema.json",
  "title": "Webhook subscription update",
  "description": "Subscription changes.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-events-api-openapi.yml#/components/schemas/WebhookSubscriptionUpdate",
  "type": "array",
  "items": {
    "$ref": "#/$defs/WebhookSubscriptionUpdateItem"
  },
  "$defs": {
    "MetadataForUpdate": {
      "title": "Metadata for update",
      "description": "Auditing details.",
      "type": "object",
      "properties": {
        "version": {
          "type": "integer",
          "description": "Version of the document.",
          "minimum": 1
        }
      }
    },
    "WebhookSubscriptionUpdateItem": {
      "title": "Webhook subscription update item",
      "type": "object",
      "description": "Object used to subscribe to/unsubscribe from an event. ",
      "properties": {
        "eventType": {
          "type": "string",
          "description": "Unique identifier of the event."
        },
        "action": {
          "type": "string",
          "enum": [
            "SUBSCRIBE",
            "UNSUBSCRIBE"
          ],
          "description": "Indicates whether the event should be subscribed to or unsubscribed from."
        },
        "metadata": {
          "$ref": "#/$defs/MetadataForUpdate"
        },
        "fieldsToUnsubscribe": {
          "type": "array",
          "description": "Fields to exclude from notification.",
          "items": {
            "type": "string"
          }
        },
        "fieldsToSubscribe": {
          "type": "array",
          "description": "Fields to re-include in the notification. To be used when user wants to subscribe to previously unsubscribed fields.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "eventType"
      ]
    }
  }
}