{
  "openapi": "3.1.0",
  "info": {
    "title": "TrustCenter Lite B2B SOC 2 Procurement Auditor API",
    "version": "1.0.0",
    "description": "Instant B2B SOC 2 Lite Trust Page & Enterprise Procurement Readiness Auditor across trust.<domain>, /dpa, /subprocessors, status.<domain>, RFC 9116 security.txt, HTTP headers, and DNS CAA/SPF/DMARC.",
    "contact": {
      "name": "RungLab Support",
      "email": "support@runglab.dev",
      "url": "https://trust.runglab.dev/"
    }
  },
  "servers": [
    {
      "url": "https://trust-api.runglab.dev",
      "description": "TrustCenter Lite Edge Audit Worker"
    },
    {
      "url": "https://api.runglab.dev",
      "description": "RungLab Funnel & Checkout API"
    }
  ],
  "paths": {
    "/api/audit": {
      "get": {
        "operationId": "auditTrustProcurementReadiness",
        "summary": "Audit a B2B domain's trust center, DPA, subprocessors, status page, security.txt, HTTP headers, and DNS CAA/SPF/DMARC",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Public company domain to audit (e.g. stripe.com)",
            "schema": {
              "type": "string",
              "example": "stripe.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "100-point Trust & Enterprise Procurement Readiness scorecard with Before->After bundle projection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustAuditReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or disallowed target domain"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getTrustCenterHealth",
        "summary": "Verify TrustCenter Lite worker health",
        "responses": {
          "200": {
            "description": "Healthy worker status JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "service": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TrustAuditReport": {
        "type": "object",
        "properties": {
          "domain": { "type": "string" },
          "probeDomain": { "type": "string" },
          "overallScore": { "type": "integer", "minimum": 0, "maximum": 100 },
          "grade": { "type": "string" },
          "beforeAfterUplift": { "type": "object" },
          "findings": { "type": "array", "items": { "type": "object" } }
        }
      }
    }
  }
}
