{
  "openapi": "3.1.0",
  "info": {
    "title": "Doormat Capital mailcheck API",
    "version": "1.0.0",
    "description": "Scores a domain's MX/SPF/DMARC setup for free; /report adds a DKIM selector probe and ready-to-paste fix records, paid in USDC on Base (x402). Pay by sending USDC to the address in the 402 challenge, then retry with header X-PAYMENT-TX: <tx hash>.",
    "x-guidance": "Free: GET /check?domain=<domain> scores MX/SPF/DMARC. Paid: GET /report?domain=<domain> adds a DKIM probe and fix records -- pay the USDC amount in the 402 challenge to the given address on Base, then retry with header X-PAYMENT-TX: <tx hash>.",
    "contact": {
      "email": "fleur.doormatcapital@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://mailcheck.sebastiaan-ba3.workers.dev"
    }
  ],
  "paths": {
    "/report": {
      "get": {
        "operationId": "reportMailAuth",
        "summary": "DKIM selector probe and SPF/DMARC fix snippets",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "example.com"
            },
            "description": "Domain to check mail-auth (MX/SPF/DMARC/DKIM) for."
          }
        ],
        "responses": {
          "200": {
            "description": "Report returned, once paid."
          },
          "402": {
            "description": "Payment required.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "402 Payment Required (x402 v2). See the PAYMENT-REQUIRED response header (base64 JSON) for the machine-readable challenge; this body carries the same information plus human-readable how_to_pay steps."
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Domain to check mail-auth (MX/SPF/DMARC/DKIM) for."
                  }
                }
              }
            }
          }
        },
        "x-402": {
          "accepts": [
            {
              "scheme": "exact",
              "network": "eip155:8453",
              "payTo": "0x202B73254C28fA012BD11ff50425D94534b95594",
              "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "20000",
              "maxTimeoutSeconds": 300,
              "extra": {
                "name": "USD Coin",
                "version": "2"
              }
            }
          ]
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    }
  }
}