{
  "openapi": "3.1.0",
  "info": {
    "title": "Paladin Front PHP Rescue & Zero-PHP Migration API",
    "version": "1.0.0",
    "description": "I am Blaise Pascual, founder and lead systems architect of Paladin Front, veteran and former USMC officer. I provide this API to scan WordPress and PHP websites for critical PHP2Shell vulnerabilities (CVE-2026-109618 & CVE-2026-109619, CVSS 9.2), perform live HTTP runtime header audits, generate instant zero-PHP Next.js App Router replacement previews, and handle Model Context Protocol (MCP) JSON-RPC 2.0 requests.",
    "contact": {
      "name": "Blaise Pascual",
      "email": "inbox@blaisep.com",
      "url": "https://paladinfront.com/php-rescue"
    },
    "license": {
      "name": "Proprietary - Sovereign IP Transfer Available",
      "url": "https://paladinfront.com/php-rescue"
    }
  },
  "servers": [
    {
      "url": "https://paladinfront.com"
    }
  ],
  "paths": {
    "/api/web-factory/scrape-php": {
      "post": {
        "operationId": "convertAndScanPhpWebsite",
        "summary": "Scan and convert a PHP or WordPress website into a zero-PHP Next.js preview",
        "description": "I inspect the target website HTTP runtime headers, detect PHP2Shell (CVE-2026-109618 & CVE-2026-109619, CVSS 9.2) exposure, scrape the public landing content, and compile an instant, zero-PHP Next.js App Router live preview with Stripe claim integration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The target WordPress or PHP website URL to inspect and convert (e.g. 'https://example.com')."
                  },
                  "abVariant": {
                    "type": "string",
                    "enum": ["A", "B", "C"],
                    "default": "A",
                    "description": "Optional A/B testing paywall variant for the converted preview."
                  }
                },
                "required": ["url"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Website successfully inspected and converted into a zero-PHP preview.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "businessName": {
                      "type": "string"
                    },
                    "previewUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "claimUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "humanSupportPhone": {
                      "type": "string"
                    },
                    "bookingUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "site": {
                      "type": "object"
                    },
                    "phpVulnerability": {
                      "type": "object",
                      "properties": {
                        "originalDomain": {
                          "type": "string"
                        },
                        "cveIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "cvssScore": {
                          "type": "number"
                        },
                        "scannedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "isFallback": {
                      "type": "boolean"
                    },
                    "headersDetected": {
                      "type": "object",
                      "properties": {
                        "server": {
                          "type": "string"
                        },
                        "xPoweredBy": {
                          "type": "string"
                        },
                        "isPhp": {
                          "type": "boolean"
                        },
                        "isWordPress": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "previewUrl",
                    "claimUrl",
                    "humanSupportPhone",
                    "bookingUrl"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid URL or disallowed target (SSRF security violation).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": ["ok", "error"]
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "executeMcpJsonRpc",
        "summary": "Execute a Model Context Protocol (MCP) JSON-RPC 2.0 message",
        "description": "I process standard JSON-RPC 2.0 MCP protocol requests including initialize, ping, tools/list, tools/call, resources/list, resources/read, prompts/list, and prompts/get for PHP2Shell vulnerability scanning and zero-PHP Next.js migration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": ["2.0"],
                    "description": "JSON-RPC version specification."
                  },
                  "id": {
                    "description": "Unique identifier established by the client; omitted or null for notifications.",
                    "oneOf": [
                      { "type": "string" },
                      { "type": "integer" },
                      { "type": "null" }
                    ]
                  },
                  "method": {
                    "type": "string",
                    "description": "The MCP method to invoke (e.g. 'initialize', 'ping', 'tools/list', 'tools/call', 'resources/list', 'resources/read', 'prompts/list', 'prompts/get')."
                  },
                  "params": {
                    "type": "object",
                    "description": "Method-specific parameters object."
                  }
                },
                "required": ["jsonrpc", "method"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response object containing either result or error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": ["2.0"]
                    },
                    "id": {
                      "oneOf": [
                        { "type": "string" },
                        { "type": "integer" },
                        { "type": "null" }
                      ]
                    },
                    "result": {
                      "type": "object",
                      "description": "Method result payload on success."
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object"
                        }
                      },
                      "required": ["code", "message"]
                    }
                  },
                  "required": ["jsonrpc"]
                }
              }
            }
          },
          "204": {
            "description": "No content returned for JSON-RPC notifications."
          }
        }
      }
    }
  }
}
