{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emporix/json-schema/emporix-webhook-subscriptions-schema.json",
  "title": "Webhook subscriptions",
  "description": "Details of the event subscription.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-events-api-openapi.yml#/components/schemas/WebhookSubscriptions",
  "type": "array",
  "items": {
    "$ref": "#/$defs/WebhookSubscription"
  },
  "$defs": {
    "Metadata": {
      "title": "Metadata",
      "description": "Auditing details.",
      "type": "object",
      "properties": {
        "createdAt": {
          "type": "string",
          "description": "Date and time when the document was created.",
          "format": "date-time"
        },
        "modifiedAt": {
          "type": "string",
          "description": "Date and time when the document was last modified.",
          "format": "date-time"
        },
        "version": {
          "type": "integer",
          "description": "Version of the document.",
          "minimum": 1
        }
      }
    },
    "WebhookEvent": {
      "title": "Webhook event",
      "type": "object",
      "description": "Events that you can subscribe to.",
      "properties": {
        "type": {
          "type": "string",
          "description": "Unique identifier of the event."
        },
        "description": {
          "type": "object",
          "description": "Map of key-value pairs containing localized descriptions of the event, which includes information on when the event is emitted.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "eventSchema": {
          "type": "object",
          "description": "Schema of the event."
        },
        "name": {
          "type": "object",
          "description": "Map of key-value pairs containing localized names of the event.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "group": {
          "type": "object",
          "description": "Map of key-value pairs containing the localized name of a group the event belongs to.",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "WebhookSubscription": {
      "title": "Webhook subscription",
      "type": "object",
      "description": "Subscription per event.",
      "properties": {
        "event": {
          "$ref": "#/$defs/WebhookEvent"
        },
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "subscription": {
          "type": "string",
          "description": "Status of the subscription.",
          "enum": [
            "SUBSCRIBED",
            "UNSUBSCRIBED",
            "NONE"
          ]
        },
        "excludedFields": {
          "type": "array",
          "description": "If `subscription` is of type `SUBSCRIBED`, `excludedFields` will contain the list of keys from the \"event.eventSchema\" that the user has previously unsubscribed from. Note: Only root level fields are supported.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}