{
  "openapi": "3.1.0",
  "info": {
    "title": "MailAuth Pro by RungLab — Google/Yahoo/Microsoft 2025-2026 Bulk-Sender, SPF 10-Lookup, DKIM, DMARC, MTA-STS & BIMI Auditor",
    "version": "1.0.0",
    "description": "Deterministic 100-point email deliverability auditor covering SPF recursive lookup hygiene (20 pts), DMARC enforcement & rua (20 pts), 13 DKIM selectors & key strength (15 pts), RFC 8461 MTA-STS (15 pts), RFC 8460 TLS-RPT, MX redundancy & CAA (15 pts), and BIMI SVG Tiny P/S (15 pts), plus bulkSenderCompliant verdict and $39 6-File Pack.",
    "contact": {
      "name": "RungLab Support",
      "email": "support@runglab.dev",
      "url": "https://mail.runglab.dev/"
    }
  },
  "servers": [
    {
      "url": "https://mail-api.runglab.dev",
      "description": "MailAuth Pro Edge Audit Worker"
    },
    {
      "url": "https://api.runglab.dev",
      "description": "RungLab Checkout, Lead & Funnel Telemetry API"
    }
  ],
  "paths": {
    "/api/audit": {
      "get": {
        "operationId": "auditMailAuthDomain",
        "summary": "Audit a live public domain via DoH & SSRF-hardened HTTPS probes for SPF, DKIM, DMARC, MTA-STS, TLS-RPT & BIMI",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Public domain to audit (e.g. stripe.com)",
            "schema": { "type": "string", "example": "stripe.com" }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "description": "Set to 1 to bypass the 600s edge cache",
            "schema": { "type": "string", "enum": ["0", "1"] }
          }
        ],
        "responses": {
          "200": {
            "description": "100-point MailAuth Pro audit report with bulkSenderCompliant, recursive SPF tree, findings MAIL-001..MAIL-018, and beforeAfterUplift"
          },
          "400": { "description": "Invalid target domain" },
          "422": { "description": "Blocked by SSRF policy" }
        }
      },
      "post": {
        "operationId": "auditMailAuthDomainPost",
        "summary": "Audit a live public domain via JSON POST { domain }",
        "responses": {
          "200": { "description": "100-point MailAuth Pro audit report" },
          "400": { "description": "Invalid domain or JSON body" },
          "422": { "description": "Blocked by SSRF policy" }
        }
      }
    },
    "/api/audit-dns": {
      "post": {
        "operationId": "auditOfflineDnsRecords",
        "summary": "Zero-network offline audit of pasted SPF, DMARC, DKIM, _mta-sts, mta-sts.txt, TLS-RPT, MX, CAA & BIMI SVG Tiny P/S",
        "responses": {
          "200": { "description": "Zero-network 100-point MailAuth Pro audit report (0 outbound requests)" },
          "400": { "description": "Invalid input JSON or missing DNS/MTA-STS artifacts" }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getMailAuthHealth",
        "summary": "Verify MailAuth Pro edge worker health",
        "responses": {
          "200": { "description": "Healthy worker status JSON" }
        }
      }
    }
  }
}
