{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/predoc/json-schema/predoc-webhook-config-resp-dto-schema.json",
  "title": "WebhookConfigRespDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/predoc-events-api-openapi.yml#/components/schemas/WebhookConfigRespDto",
  "type": "object",
  "properties": {
    "configurationId": {
      "type": "string",
      "description": "Webhook configuration identifier.",
      "format": "uuid"
    },
    "eventType": {
      "description": "Subscribed webhook event type.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookEventType"
        }
      ]
    },
    "serviceName": {
      "type": "string",
      "description": "Human-readable webhook service name."
    },
    "url": {
      "type": "string",
      "description": "Webhook delivery URL."
    },
    "notificationEmail": {
      "type": "string",
      "description": "Notification email used for repeated delivery failures."
    },
    "isActive": {
      "type": "boolean",
      "description": "Whether this configuration is active."
    },
    "customHeaders": {
      "description": "Custom headers that will be appended to webhook deliveries.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookCustomHeaderRespDto"
      }
    }
  },
  "required": [
    "configurationId",
    "eventType",
    "serviceName",
    "url",
    "notificationEmail",
    "isActive",
    "customHeaders"
  ],
  "$defs": {
    "WebhookCustomHeaderRespDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Header name appended to webhook deliveries."
        },
        "value": {
          "type": "string",
          "description": "Header value appended to webhook deliveries."
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "REQUEST_COMPLETE",
        "RETRIEVAL_COMPLETE",
        "DOCUMENT_UPLOADED",
        "ANALYSIS_COMPLETE",
        "ANONYMOUS_RECORD_UPLOAD_COMPLETED",
        "ANONYMOUS_RECORD_UPLOAD_ERROR",
        "CURATED_DATA"
      ],
      "description": "Subscribed webhook event type."
    }
  }
}