{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pingzen-dev/json-schema/pingzen-dev-create-monitor-request-schema.json",
  "title": "CreateMonitorRequest",
  "description": "Request schema for creating a monitor.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pingzen-dev-openapi.json#/components/schemas/CreateMonitorRequest",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Name",
      "description": "Monitor name"
    },
    "url": {
      "type": "string",
      "maxLength": 2048,
      "minLength": 1,
      "title": "Url",
      "description": "URL or host to monitor"
    },
    "protocol": {
      "type": "string",
      "title": "Protocol",
      "description": "Protocol: HTTP, HTTPS, TCP, ICMP, DNS, GRPC"
    },
    "workspace_id": {
      "type": "integer",
      "maximum": 2147483647.0,
      "minimum": 1.0,
      "title": "Workspace Id",
      "description": "Workspace ID to assign monitor to"
    },
    "probe_id": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 2147483647.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Probe Id",
      "description": "Single probe ID (legacy). DEPRECATED — pass `probe_ids` instead. Will be removed 2026-07-27. If both fields are supplied, `probe_ids` wins.",
      "deprecated": true
    },
    "probe_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer",
            "maximum": 2147483647.0,
            "minimum": 1.0
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Probe Ids",
      "description": "Probe IDs to assign for multi-region checks. None = legacy single-probe via `probe_id`. Empty list = detach all probes (central server). Plan caps: FREE=1, PRO=3, BUSINESS=10, ENTERPRISE=50."
    },
    "aggregation_rule": {
      "type": "string",
      "title": "Aggregation Rule",
      "description": "How per-probe states combine into Monitor.status. MVP: only `any_fails` (DOWN if any probe confirms 3 consecutive failures). `majority_fail` and `all_fail` reserved at schema level.",
      "default": "any_fails"
    },
    "interval_seconds": {
      "type": "integer",
      "maximum": 86400.0,
      "minimum": 10.0,
      "title": "Interval Seconds",
      "description": "Check interval in seconds (up to 86400 for WHOIS)",
      "default": 60
    },
    "timeout_seconds": {
      "type": "integer",
      "maximum": 120.0,
      "minimum": 1.0,
      "title": "Timeout Seconds",
      "description": "Timeout in seconds (5s default, up to 120s for PageSpeed)",
      "default": 5
    },
    "http_method": {
      "type": "string",
      "title": "Http Method",
      "description": "HTTP method (GET, POST, HEAD, etc.)",
      "default": "GET"
    },
    "headers": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Headers",
      "description": "HTTP headers"
    },
    "expected_status": {
      "type": "integer",
      "maximum": 599.0,
      "minimum": 100.0,
      "title": "Expected Status",
      "description": "Expected HTTP status code",
      "default": 200
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Keyword",
      "description": "Keyword to search in response"
    },
    "keyword_present": {
      "type": "boolean",
      "title": "Keyword Present",
      "description": "Whether keyword should be present or absent",
      "default": true
    },
    "keyword_type": {
      "type": "string",
      "pattern": "^(contains|not_contains|regex)$",
      "title": "Keyword Type",
      "description": "Keyword match type: contains, not_contains, or regex",
      "default": "contains"
    },
    "json_path": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Json Path",
      "description": "JSON path to check"
    },
    "json_expected_value": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Json Expected Value",
      "description": "Expected JSON value"
    },
    "follow_redirects": {
      "type": "boolean",
      "title": "Follow Redirects",
      "description": "Whether to follow HTTP redirects",
      "default": true
    },
    "verify_ssl": {
      "type": "boolean",
      "title": "Verify Ssl",
      "description": "Whether to verify SSL certificate",
      "default": true
    },
    "trust_extra_anchor_any_tld": {
      "type": "boolean",
      "title": "Trust Extra Anchor Any Tld",
      "description": "Allow the extra-anchor (НУЦ) fallback to green this host even if it is outside .ru/.su/.рф (e.g. a Russian operator serving a НУЦ cert on a .com domain). Off by default.",
      "default": false
    },
    "detect_stub_pages": {
      "type": "boolean",
      "title": "Detect Stub Pages",
      "description": "Detect domain-parking / hosting-suspension pages on HTTP 200",
      "default": true
    },
    "auth_type": {
      "type": "string",
      "pattern": "^(none|basic|bearer|digest|api_key)$",
      "title": "Auth Type",
      "description": "HTTP auth: none, basic, bearer, digest or api_key",
      "default": "none"
    },
    "auth_username": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Auth Username"
    },
    "auth_password": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Auth Password"
    },
    "auth_token": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ],
      "title": "Auth Token",
      "description": "Bearer token or API key"
    },
    "auth_header_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Auth Header Name",
      "description": "Header for api_key auth (default X-API-Key)"
    },
    "retry_count": {
      "type": "integer",
      "maximum": 5.0,
      "minimum": 0.0,
      "title": "Retry Count",
      "description": "Number of retries before marking as DOWN (0-5)",
      "default": 2
    },
    "retry_delay_seconds": {
      "type": "number",
      "maximum": 10.0,
      "minimum": 0.5,
      "title": "Retry Delay Seconds",
      "description": "Base delay between retries in seconds",
      "default": 2.0
    },
    "grpc_service_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Grpc Service Name",
      "description": "gRPC service name for health check"
    },
    "grpc_use_tls": {
      "type": "boolean",
      "title": "Grpc Use Tls",
      "description": "Use TLS for gRPC",
      "default": false
    },
    "tcp_expect_banner": {
      "type": "boolean",
      "title": "Tcp Expect Banner",
      "description": "Expect a banner/greeting",
      "default": false
    },
    "tcp_expected_banner": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Tcp Expected Banner",
      "description": "Expected banner content"
    },
    "ping_count": {
      "type": "integer",
      "maximum": 10.0,
      "minimum": 1.0,
      "title": "Ping Count",
      "description": "Number of pings",
      "default": 4
    },
    "ping_packet_size": {
      "type": "integer",
      "maximum": 1500.0,
      "minimum": 32.0,
      "title": "Ping Packet Size",
      "description": "ICMP packet size in bytes (RFC 792 default: 64)",
      "default": 64
    },
    "confirmation_threshold": {
      "type": "integer",
      "maximum": 10.0,
      "minimum": 1.0,
      "title": "Confirmation Threshold",
      "description": "Consecutive failures before marking DOWN (Pingdom/Datadog standard)",
      "default": 3
    },
    "recovery_threshold": {
      "type": "integer",
      "maximum": 5.0,
      "minimum": 1.0,
      "title": "Recovery Threshold",
      "description": "Consecutive successes before marking UP",
      "default": 2
    },
    "grace_period_seconds": {
      "type": "integer",
      "maximum": 3600.0,
      "minimum": 0.0,
      "title": "Grace Period Seconds",
      "description": "Extra time before alerting (0-3600 seconds)",
      "default": 0
    },
    "response_time_warn_ms": {
      "type": "integer",
      "maximum": 60000.0,
      "minimum": 0.0,
      "title": "Response Time Warn Ms",
      "description": "Warning if RTT > X ms (0=disabled)",
      "default": 0
    },
    "response_time_critical_ms": {
      "type": "integer",
      "maximum": 60000.0,
      "minimum": 0.0,
      "title": "Response Time Critical Ms",
      "description": "Critical if RTT > X ms (0=disabled)",
      "default": 0
    },
    "packet_loss_warn_percent": {
      "type": "number",
      "maximum": 100.0,
      "minimum": 0.0,
      "title": "Packet Loss Warn Percent",
      "description": "Warning if packet loss > X% (0=disabled)",
      "default": 0.0
    },
    "packet_loss_critical_percent": {
      "type": "number",
      "maximum": 100.0,
      "minimum": 0.0,
      "title": "Packet Loss Critical Percent",
      "description": "Critical if packet loss > X% (0=disabled)",
      "default": 0.0
    },
    "dns_record_type": {
      "type": "string",
      "title": "Dns Record Type",
      "description": "DNS record type (A, AAAA, MX, TXT, etc.)",
      "default": "A"
    },
    "dns_expected_values": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dns Expected Values",
      "description": "Expected DNS resolution values"
    },
    "dns_server": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 45
        },
        {
          "type": "null"
        }
      ],
      "title": "Dns Server",
      "description": "DNS only: IP address of the DNS server to ask instead of public DNS, port 53. A local-network address needs your private checker in that network."
    },
    "ws_send_message": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ],
      "title": "Ws Send Message",
      "description": "Message to send after WebSocket connect"
    },
    "ws_expected_response": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ],
      "title": "Ws Expected Response",
      "description": "Expected WebSocket response"
    },
    "ssl_warn_days": {
      "type": "integer",
      "maximum": 365.0,
      "minimum": 1.0,
      "title": "Ssl Warn Days",
      "description": "Days before expiry to warn (default 14). At check time both thresholds are additionally capped by the certificate lifetime: warn ≤ lifetime/3, critical ≤ lifetime/6 — so short-lived certs are not permanently degraded.",
      "default": 14
    },
    "ssl_critical_days": {
      "type": "integer",
      "maximum": 30.0,
      "minimum": 1.0,
      "title": "Ssl Critical Days",
      "description": "Days before expiry for critical alert",
      "default": 7
    },
    "whois_warn_days": {
      "type": "integer",
      "maximum": 365.0,
      "minimum": 1.0,
      "title": "Whois Warn Days",
      "description": "Days before domain expiry to warn",
      "default": 30
    },
    "whois_critical_days": {
      "type": "integer",
      "maximum": 30.0,
      "minimum": 1.0,
      "title": "Whois Critical Days",
      "description": "Days before domain expiry for critical alert",
      "default": 7
    },
    "smtp_use_starttls": {
      "type": "boolean",
      "title": "Smtp Use Starttls",
      "description": "Use STARTTLS for SMTP",
      "default": true
    },
    "smtp_verify_tls": {
      "type": "boolean",
      "title": "Smtp Verify Tls",
      "description": "Verify TLS certificate for SMTP",
      "default": true
    },
    "imap_use_ssl": {
      "type": "boolean",
      "title": "Imap Use Ssl",
      "description": "Use SSL for IMAP (port 993 vs 143)",
      "default": true
    },
    "pop3_use_ssl": {
      "type": "boolean",
      "title": "Pop3 Use Ssl",
      "description": "Use SSL for POP3 (port 995 vs 110)",
      "default": true
    },
    "ftp_use_tls": {
      "type": "boolean",
      "title": "Ftp Use Tls",
      "description": "Use TLS for FTP (FTPS)",
      "default": false
    },
    "ftp_username": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Ftp Username",
      "description": "FTP username (defaults to anonymous)"
    },
    "ftp_password": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Ftp Password",
      "description": "FTP password"
    },
    "socks5_auth_required": {
      "type": "boolean",
      "title": "Socks5 Auth Required",
      "description": "Whether SOCKS5 proxy requires username/password auth",
      "default": false
    },
    "socks5_username": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Socks5 Username",
      "description": "SOCKS5 username (max 255 per RFC 1929)"
    },
    "socks5_password": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Socks5 Password",
      "description": "SOCKS5 password (max 255 per RFC 1929)"
    },
    "socks5_test_target": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Socks5 Test Target",
      "description": "Optional host:port for proxy-through CONNECT test (e.g. google.com:80)"
    },
    "mtproxy_secret": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Mtproxy Secret",
      "description": "MTProxy secret (plain: 32 hex, dd: dd+32 hex, ee: ee+32 hex+domain_hex, or base64)"
    },
    "dnsbl_servers": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "maxLength": 200,
            "minLength": 3,
            "pattern": "^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$"
          },
          "type": "array",
          "maxItems": 50
        },
        {
          "type": "null"
        }
      ],
      "title": "Dnsbl Servers",
      "description": "Custom DNSBL providers (hostnames). Empty/None → pydnsbl default list (zen.spamhaus.org, bl.spamcop.net, etc.)"
    },
    "pagespeed_strategy": {
      "type": "string",
      "pattern": "^(mobile|desktop)$",
      "title": "Pagespeed Strategy",
      "description": "PageSpeed strategy: mobile or desktop",
      "default": "mobile"
    },
    "pagespeed_threshold": {
      "type": "integer",
      "maximum": 100.0,
      "minimum": 0.0,
      "title": "Pagespeed Threshold",
      "description": "Performance score threshold for DEGRADED status (0-100)",
      "default": 50
    },
    "rtsp_settings": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rtsp Settings",
      "description": "RTSP camera settings, every key optional: video_check_interval_seconds (300-86400, turns the video check on), min_fps (0 turns the frame-rate check off), max_keyframe_interval_s, min_bitrate_kbps, expected_codec (H264, H265, JPEG), expected_width with expected_height."
    },
    "host_settings": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Host Settings",
      "description": "SSH host check (protocol host): username, and private_key or password. Optional thresholds: load_warn, load_critical (5-minute load divided by CPU count), disk_warn_percent, disk_critical_percent, inode_warn_percent, inode_critical_percent, fd_warn_percent, fd_critical_percent, mem_avail_warn_percent, mem_avail_critical_percent (available memory at or below this percent), swap_warn_percent, swap_critical_percent, ignore_mounts. Linux and macOS only; Windows fails the check."
    },
    "udp_payload": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Udp Payload",
      "description": "Custom UDP payload to send"
    },
    "udp_expect_response": {
      "type": "boolean",
      "title": "Udp Expect Response",
      "description": "Whether to wait for a UDP response",
      "default": true
    },
    "udp_expected_response": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 1000
        },
        {
          "type": "null"
        }
      ],
      "title": "Udp Expected Response",
      "description": "Expected content in UDP response"
    },
    "api_check_config": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Check Config",
      "description": "API check configuration (steps, assertions, auth, variables)"
    },
    "transaction_steps": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Transaction Steps",
      "description": "Transaction step configurations"
    },
    "transaction_viewport_width": {
      "type": "integer",
      "maximum": 3840.0,
      "minimum": 320.0,
      "title": "Transaction Viewport Width",
      "default": 1920
    },
    "transaction_viewport_height": {
      "type": "integer",
      "maximum": 2160.0,
      "minimum": 240.0,
      "title": "Transaction Viewport Height",
      "default": 1080
    },
    "transaction_user_agent": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Transaction User Agent"
    },
    "transaction_screenshot_on_error": {
      "type": "boolean",
      "title": "Transaction Screenshot On Error",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "name",
    "url",
    "protocol",
    "workspace_id"
  ]
}