{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/0xinsider-com/json-schema/0xinsider-com-create-webhook-request-schema.json",
  "title": "CreateWebhookRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/0xinsider-com-webhooks-api-openapi.yml#/components/schemas/CreateWebhookRequest",
  "type": "object",
  "required": [
    "name",
    "url",
    "event_types"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Public HTTPS callback URL on the default port 443. Local, private, and internal targets are rejected, as is any explicit port other than 443 and any URL carrying credentials. Each user's URLs are unique after normalizing HTTPS scheme/host case, trailing DNS dots and port 443; path/query case is preserved. Pending verification and PATCH-disabled endpoints still reserve their stored URL. The destination must answer the signed webhook.verification challenge with a 2xx before POST /api/v1/webhooks/{id}/verify can activate the endpoint."
    },
    "event_types": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      }
    },
    "trade_filters": {
      "$ref": "#/$defs/LargeTradeSubscriptionFilters"
    }
  },
  "$defs": {
    "LargeTradeSubscriptionFilters": {
      "type": "object",
      "additionalProperties": false,
      "description": "All present fields narrow large_trade_inserted_v2 delivery. Grade is observed at publication; ungraded trades do not match min_grade. An empty object matches every large trade.",
      "properties": {
        "condition_id": {
          "type": "string",
          "description": "Raw provider condition ID or mkt_-prefixed market ID."
        },
        "wallet": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$",
          "description": "Polymarket wallet address; matching is case-insensitive."
        },
        "min_grade": {
          "type": "string",
          "enum": [
            "S",
            "A",
            "B",
            "C",
            "D",
            "F"
          ],
          "description": "S is best; ungraded trades do not match."
        },
        "min_size_usd": {
          "type": "string",
          "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
          "description": "Positive USD notional as an exact decimal string."
        }
      }
    },
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "large_trade_inserted_v2",
        "large_trades_inserted",
        "whale_trades_inserted",
        "live_sports_updated",
        "trader_synced",
        "whale_trader_synced",
        "large_positions_updated",
        "wallet_grade_changed",
        "suspicious_trade_flagged",
        "insider_radar_flag_raised",
        "sharp_money_flow_detected",
        "smart_money_flow_detected",
        "export_job_ready",
        "export_job_failed",
        "export_job_expired",
        "export_job_cancelled"
      ]
    }
  }
}