{
  "openapi": "3.1.0",
  "info": {
    "title": "Hyring Public API",
    "description": "Public API endpoints for Hyring – AI Hiring Platform",
    "version": "1.0.0",
    "contact": {
      "name": "Hyring Support",
      "url": "https://hyring.com/help-desk"
    }
  },
  "servers": [
    { "url": "https://hyring.com", "description": "Production" }
  ],
  "paths": {
    "/api/mcp": {
      "post": {
        "summary": "MCP JSON-RPC endpoint",
        "description": "Model Context Protocol (MCP) server endpoint. Accepts JSON-RPC 2.0 requests for agent tool discovery and invocation.",
        "operationId": "mcpHandler",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["jsonrpc", "method"],
                "properties": {
                  "jsonrpc": { "type": "string", "enum": ["2.0"] },
                  "id": { "type": ["string", "integer", "null"] },
                  "method": { "type": "string" },
                  "params": { "type": "object" }
                }
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "initialize"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": { "type": "string" },
                    "id": { "type": ["string", "integer", "null"] },
                    "result": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/md": {
      "get": {
        "summary": "HTML to Markdown conversion",
        "description": "Returns a markdown representation of any hyring.com page. Used internally when agents send Accept: text/markdown.",
        "operationId": "mdHandler",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": true,
            "description": "Site-relative path to convert (e.g. /ai-interviewer)",
            "schema": { "type": "string", "example": "/" }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown content",
            "content": {
              "text/markdown": {
                "schema": { "type": "string" }
              }
            },
            "headers": {
              "x-markdown-tokens": {
                "description": "Approximate token count of the markdown body",
                "schema": { "type": "integer" }
              }
            }
          }
        }
      }
    }
  }
}
