{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/0si-ai/json-schema/0si-ai-webhook-input-schema.json",
  "title": "WebhookInput",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/0si-ai-openapi.json#/components/schemas/WebhookInput",
  "type": "object",
  "required": [
    "name",
    "url"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Public HTTPS endpoint on port 443."
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "disclosure.created",
          "disclosure.updated"
        ]
      }
    },
    "markets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "uniqueItems": true,
      "default": [
        "KR",
        "US"
      ],
      "items": {
        "type": "string",
        "enum": [
          "KR",
          "US"
        ]
      },
      "description": "Delivery markets. Existing and omitted configurations receive both markets."
    },
    "filing_forms": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "default": [],
      "items": {
        "$ref": "#/$defs/SecForm"
      },
      "description": "Optional SEC base-form filter. Applies only to US events and includes amendments."
    },
    "stock_codes": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "default": [],
      "items": {
        "type": "string",
        "maxLength": 15
      },
      "description": "Optional Korean stock codes or US tickers. Empty delivers every stock."
    },
    "sentiments": {
      "type": "array",
      "maxItems": 5,
      "uniqueItems": true,
      "default": [],
      "items": {
        "$ref": "#/$defs/Sentiment"
      },
      "description": "Optional sentiment filter evaluated when the event is recorded."
    },
    "watchlist_only": {
      "type": "boolean",
      "default": false,
      "description": "Deliver only stocks saved in the owner's 0si.ai watchlist at event time."
    },
    "enabled": {
      "type": "boolean",
      "default": true
    }
  },
  "$defs": {
    "SecForm": {
      "type": "string",
      "pattern": "^[A-Z0-9][A-Z0-9 .-]{0,30}(/A)?$"
    },
    "Sentiment": {
      "type": "string",
      "enum": [
        "very_positive",
        "positive",
        "neutral",
        "negative",
        "very_negative"
      ]
    }
  }
}