{
  "openapi": "3.1.0",
  "info": {
    "title": "ReadyCheck AEO, Email & Security Auditor API",
    "version": "1.0.0",
    "description": "Live 100-point AI Search & Agent Readiness (12 AI crawlers, llms.txt, A2A agent-card.json, Schema.org JSON-LD), Email Deliverability (SPF, DMARC, DKIM, MX, MTA-STS, BIMI), and Web Security Headers auditor.",
    "contact": {
      "name": "RungLab Support",
      "email": "support@runglab.dev",
      "url": "https://audit.runglab.dev/"
    }
  },
  "servers": [
    {
      "url": "https://audit-api.runglab.dev",
      "description": "ReadyCheck Edge Audit Worker"
    },
    {
      "url": "https://hub.runglab.dev",
      "description": "RungLab Developer Intelligence API Hub"
    }
  ],
  "paths": {
    "/api/audit": {
      "get": {
        "operationId": "auditDomainReadiness",
        "summary": "Audit domain across AEO (40 pts), Email Deliverability (35 pts), and Security Headers (25 pts)",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Public domain or URL to audit (e.g. stripe.com)",
            "schema": {
              "type": "string",
              "example": "stripe.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deterministic 100-point audit scorecard with findings and remediation previews",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or disallowed target domain"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getReadyCheckHealth",
        "summary": "Verify ReadyCheck worker health and DNS/SSRF resolver status",
        "responses": {
          "200": {
            "description": "Healthy worker status JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "service": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuditReport": {
        "type": "object",
        "properties": {
          "domain": { "type": "string" },
          "overallScore": { "type": "integer", "minimum": 0, "maximum": 100 },
          "grade": { "type": "string" },
          "pillars": { "type": "object" },
          "findings": { "type": "array", "items": { "type": "object" } }
        }
      }
    }
  }
}
