{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/predoc/json-schema/predoc-webhook-configuration-create-inp-dto-schema.json",
  "title": "WebhookConfigurationCreateInpDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/predoc-events-api-openapi.yml#/components/schemas/WebhookConfigurationCreateInpDto",
  "type": "object",
  "properties": {
    "eventType": {
      "description": "The event type to subscribe to.",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookEventType"
        }
      ]
    },
    "serviceName": {
      "type": "string",
      "description": "The service name to subscribe to"
    },
    "notificationEmail": {
      "type": "string",
      "description": "The email to send a notification to if/when the amount of sending retries exceeded"
    },
    "webhookUri": {
      "type": "string",
      "description": "The webhook URI to subscribe to"
    },
    "customHeaders": {
      "description": "Optional custom headers appended to webhook deliveries",
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookCustomHeaderDto"
      }
    }
  },
  "required": [
    "eventType",
    "serviceName",
    "notificationEmail",
    "webhookUri"
  ],
  "$defs": {
    "WebhookCustomHeaderDto": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Header name that will be sent with webhook requests",
          "minLength": 1,
          "maxLength": 100
        },
        "value": {
          "type": "string",
          "description": "Header value that will be sent with webhook requests",
          "minLength": 1,
          "maxLength": 4000
        }
      },
      "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."
    }
  }
}