{
  "openapi": "3.0.3",
  "info": {
    "title": "MailCheck Edge API — Email Deliverability, Disposable, MX, SPF & DMARC Validator",
    "version": "1.0.0",
    "description": "Zero-proxy Cloudflare Edge API for real-time email verification, disposable/burner domain blocking, typo suggestions, batch validation (up to 25 emails/call), and full domain MX/SPF/DMARC/BIMI/MTA-STS security auditing.",
    "contact": {
      "name": "MailCheck Edge Support",
      "url": "https://github.com/bugkerb/mailcheck-edge-api"
    },
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://mailcheck-edge-api.jiratthapol.workers.dev",
      "description": "Production Cloudflare Edge Endpoint"
    }
  ],
  "security": [
    {
      "RapidAPIKey": []
    },
    {
      "DirectApiKey": []
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health Check",
        "operationId": "getHealth",
        "security": [],
        "responses": {
          "200": {
            "description": "Service healthy"
          }
        }
      }
    },
    "/v1/validate": {
      "get": {
        "summary": "Validate Single Email Address",
        "description": "Validates syntax, detects typos (didYouMean), blocks 200+ disposable/burner domains, classifies free/role/corporate emails, and inspects live MX, SPF, and DMARC DNS records via Cloudflare DoH.",
        "operationId": "validateEmail",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "Email address to validate",
            "schema": {
              "type": "string",
              "format": "email",
              "example": "hello@stripe.com"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validation result"
          },
          "400": {
            "description": "Invalid email, domain, or payload"
          },
          "401": {
            "description": "Invalid API key or RapidAPI proxy secret"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      },
      "post": {
        "summary": "Validate Single Email Address (POST JSON)",
        "operationId": "postValidateEmail",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "example": "hello@stripe.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          },
          "400": {
            "description": "Invalid email, domain, or payload"
          },
          "401": {
            "description": "Invalid API key or RapidAPI proxy secret"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/v1/validate/batch": {
      "post": {
        "summary": "Batch Validate Up to 25 Emails",
        "description": "Validates up to 25 emails in a single edge request with deduplicated parallel DNS lookups per unique domain.",
        "operationId": "validateBatchEmails",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "emails"
                ],
                "properties": {
                  "emails": {
                    "type": "array",
                    "maxItems": 25,
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "hello@stripe.com",
                      "test@mailinator.com",
                      "user@gmial.com"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch validation summary and results"
          },
          "400": {
            "description": "Invalid email, domain, or payload"
          },
          "401": {
            "description": "Invalid API key or RapidAPI proxy secret"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/v1/domain": {
      "get": {
        "summary": "Full Domain Email Security & Deliverability Audit (MX/SPF/DMARC/BIMI/MTA-STS)",
        "description": "Audits MX records & mail provider, parses SPF & DMARC policies, checks BIMI & MTA-STS, and returns a 0-100 securityScore, A+-F securityGrade, and actionable recommendations.",
        "operationId": "auditDomain",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Domain name (or email/URL) to audit",
            "schema": {
              "type": "string",
              "example": "stripe.com"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain audit report"
          },
          "400": {
            "description": "Invalid email, domain, or payload"
          },
          "401": {
            "description": "Invalid API key or RapidAPI proxy secret"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/v1/disposable": {
      "get": {
        "summary": "Ultra-Fast Disposable & Free Provider Check",
        "description": "Sub-5ms edge lookup checking whether a domain or email belongs to a disposable/burner mail service or free consumer webmail provider.",
        "operationId": "checkDisposable",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Domain or email address to classify",
            "schema": {
              "type": "string",
              "example": "mailinator.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disposable & provider classification"
          },
          "400": {
            "description": "Invalid email, domain, or payload"
          },
          "401": {
            "description": "Invalid API key or RapidAPI proxy secret"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "RapidAPIKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-RapidAPI-Key"
      },
      "DirectApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}