{
  "openapi": "3.0.3",
  "info": {
    "title": "dns-email-security",
    "version": "1.1.0",
    "description": "Audit domain SPF/DMARC/MX email security and verify global DNS propagation across Cloudflare, Google, and Quad9 DoH. Pay-per-call USDC on Base via x402."
  },
  "servers": [
    {
      "url": "https://dns-email-security.restockalarm.workers.dev"
    }
  ],
  "paths": {
    "/v1/audit": {
      "get": {
        "summary": "Domain Email Security Audit (SPF/DMARC/MX)",
        "description": "Audit a domain's SPF, DMARC, and MX records via Cloudflare DoH and return a 0-100 email security score and spoof risk.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Bare domain name to audit",
            "schema": {
              "type": "string",
              "example": "cloudflare.com"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    },
    "/v1/dns-propagation": {
      "get": {
        "summary": "Multi-Resolver DNS Propagation Check (Cloudflare/Google/Quad9)",
        "description": "Query Cloudflare, Google, and Quad9 DoH resolvers in parallel to verify DNS record answers, TTLs, deviations, and propagation consistency.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Bare domain name to check",
            "schema": {
              "type": "string",
              "example": "cloudflare.com"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "DNS record type: A, AAAA, MX, TXT, NS, or CNAME (default A)",
            "schema": {
              "type": "string",
              "example": "A"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    },
    "/v1/domain-full-audit": {
      "get": {
        "summary": "Full Domain Security Audit",
        "description": "Full security dossier for a domain before trusting it: DNS A/MX/SPF/DMARC/CAA, RDAP registration age and HTTPS security headers, scored 0-100 with prioritized findings.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Hostname, e.g. example.com",
            "schema": {
              "type": "string",
              "example": "example.com"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.05"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    },
    "/v1/dns-lite": {
      "get": {
        "summary": "Domain Check Lite",
        "description": "Lite domain check: resolvable, MX, SPF and DMARC via DNS-over-HTTPS (Cloudflare with Google fallback), quick verdict. Pass domain.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Hostname, e.g. example.com",
            "schema": {
              "type": "string",
              "example": "example.com"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    },
    "/v1/dns-batch": {
      "get": {
        "summary": "Domain Check Batch",
        "description": "Batch domain check: up to 10 comma-separated domains, each with resolvable/MX/SPF/DMARC. Per-domain errors degrade gracefully.",
        "parameters": [
          {
            "name": "domains",
            "in": "query",
            "required": true,
            "description": "Up to 10 comma-separated domains",
            "schema": {
              "type": "string",
              "example": "example.com,cloudflare.com"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.03"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    },
    "/v1/domain-verdict": {
      "get": {
        "summary": "Domain Verdict",
        "description": "Combined domain verdict: DNS hardening (MX/SPF/DMARC) + agent visibility (robots.txt AI bots) in one OK/WARN/AVOID answer. Pass domain.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Hostname, e.g. example.com",
            "schema": {
              "type": "string",
              "example": "example.com"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USDC",
            "amount": "0.05"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "networks": [
            "eip155:8453"
          ],
          "payTo": "0x7B97303d62517eA9E26D1E1b199Eac42a487F430"
        },
        "responses": {
          "200": {
            "description": "JSON result"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required (x402)"
          }
        }
      }
    }
  }
}