MailValidation.io

API Documentation

Validate email addresses programmatically with our REST API, Python and Node.js libraries, or MCP server, or embed our widget on your site. Looking for the interactive endpoint reference? Open the Swagger API reference.


Authentication

All API requests require authentication via your API key. Find your key in your dashboard under Team → API Keys.

Include the key in the Authorization header:

Authorization: Api-Key YOUR_API_KEY

API endpoints are scoped to your team. Your team slug is the part after /a/ in your dashboard URL (app.mailvalidation.io/a/your-team-slug/). Below, {team_slug} stands for it.


Validate an Email

POST /a/{team_slug}/validate/api/validate/
Request Body
{
  "email": "user@example.com"
}
Response
{
  "id": 1234,
  "email": "user@example.com",
  "is_valid": true,
  "is_blacklist": false,
  "valid_format": true,
  "valid_domain": true,
  "valid_nameserver": true,
  "dns_timeout": false,
  "dns_config_error": false,
  "no_mx": false,
  "no_valid_mx": false,
  "disposable": false,
  "is_catch_all": false,
  "is_role_account": false,
  "is_free_email": false,
  "quality_score": 100,
  "risk_level": 0,
  "did_you_mean": "",
  "processing": false,
  "last_validated": "2026-03-11T12:00:00Z"
}
Response Fields
FieldTypeDescription
is_validbooleanWhether the mailbox exists and accepts email (SMTP RCPT TO check)
valid_formatbooleanWhether the email address syntax is valid (RFC 5322)
valid_domainbooleanWhether the domain exists in DNS
valid_nameserverbooleanWhether the domain has functioning nameservers
disposablebooleanWhether the email is from a known disposable/temporary provider
is_catch_allbooleanWhether the domain accepts all email addresses (catch-all)
is_role_accountbooleanWhether the address is a role account (info@, admin@, support@, etc.)
is_free_emailbooleanWhether the email is from a free provider (Gmail, Yahoo, Outlook, etc.)
is_blacklistbooleanWhether the domain appears on email blacklists
no_mxbooleanWhether the domain has no MX records
dns_timeoutbooleanWhether the DNS lookup timed out
risk_levelinteger 0–5Rule-based risk rating: 0 lowest risk, 1 role account, 2 inconclusive result, 3 catch-all domain, 4 disposable/blocklisted domain, 5 undeliverable. Derived from the signals above, not from a spam-trap database.
did_you_meanstringSuggested corrected address when the domain looks like a typo (e.g. sam@gmial.com → sam@gmail.com). Empty when there is no suggestion.
quality_scoreinteger 0–100 or nullConfidence score. Returned on Pro plans and above; null otherwise.
processingbooleanWhether the validation is still in progress (async)
Example (cURL)
curl -X POST https://app.mailvalidation.io/a/YOUR_TEAM_SLUG/validate/api/validate/ \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "test@example.com"}'
Status Codes
201Success — email validated
400Invalid request body
401Missing or invalid API key
402Validation limit reached — upgrade your plan
429Rate limit exceeded (1,000 requests/hour per user)
What counts toward your allowance

Every completed check uses one validation, except inconclusive results, which are refunded automatically: DNS or SMTP timeouts, servers that blocked our probe, and providers that don't allow mailbox verification. Those records show "billed": false in the dashboard. Catch-all detections are billed, because they are a definitive finding about the domain.

Bulk validation
POST /a/{team_slug}/validate/api/bulk/
{ "emails": ["a@example.com", "b@example.com"] }

Queues the batch and returns a bulk_upload_id. Batch size per request depends on your plan. Results are available per email, or you can subscribe to the bulk_complete webhook.


SDKs, MCP server & integrations

The official Python and Node.js libraries and the MCP server are small wrappers around the REST API above. They need no extra dependencies, wait for async results for you, and retry automatically when rate limited. Downloads are also listed on mailvalidation.io/developers.

You need two values, the same ones used in the REST examples: your API key (Team → API Keys) and your team slug. Every client reads them from the environment if you don't pass them in:

export MAILVALIDATION_API_KEY="your-api-key"
export MAILVALIDATION_TEAM="your-team-slug"

Python

Python 3.9+, standard library only.

pip install https://mailvalidation.io/downloads/mailvalidation-0.1.0.tar.gz
from mailvalidation import MailValidation, MailValidationError

mv = MailValidation()  # reads MAILVALIDATION_API_KEY and MAILVALIDATION_TEAM
# or: MailValidation(api_key="...", team="your-team-slug")

r = mv.validate("sam@gmial.com")     # waits until the result is ready
print(r.is_valid)                    # False
print(r.risk_level)                  # 0 (safe) to 5 (risky)
print(r.did_you_mean)                # "sam@gmail.com"

# Many at once: queued server-side, results arrive via bulk_complete webhook or per email
batch = mv.validate_bulk(["a@example.com", "b@example.com"])

# Look up an earlier result by id
r = mv.get(r.id)

try:
    mv.validate("someone@example.com")
except MailValidationError as e:
    print(e.status, e.detail)        # e.g. 402 plan limit reached, 429 trial throttle

Options: timeout (seconds per request, default 30) and max_retries (default 3). validate(email, wait=False) returns immediately with processing=True.

Node.js

Node 18+, no dependencies. TypeScript types are included.

npm install https://mailvalidation.io/downloads/mailvalidation-0.1.0.tgz
const { MailValidation, MailValidationError } = require("mailvalidation");

const mv = new MailValidation(); // reads MAILVALIDATION_API_KEY and MAILVALIDATION_TEAM
// or: new MailValidation({ apiKey: "...", team: "your-team-slug" })

const r = await mv.validate("sam@gmial.com");   // waits until the result is ready
console.log(r.is_valid, r.risk_level, r.did_you_mean); // false 5 'sam@gmail.com'

await mv.validateBulk(["a@example.com", "b@example.com"]);
const again = await mv.get(r.id);

try {
  await mv.validate("someone@example.com");
} catch (e) {
  if (e instanceof MailValidationError) console.log(e.status, e.detail);
}

Pass { wait: false } as the second argument to validate to skip polling.

MCP server (Claude, ChatGPT and other AI assistants)

The MCP server lets an AI assistant check email addresses for you during a conversation. It ships with the Python package and exposes two tools: validate_email (one address) and validate_emails (a list). Install it with the mcp extra:

pip install "mailvalidation[mcp] @ https://mailvalidation.io/downloads/mailvalidation-0.1.0.tar.gz"

Claude Code:

claude mcp add mailvalidation \
  --env MAILVALIDATION_API_KEY=your-api-key \
  --env MAILVALIDATION_TEAM=your-team-slug \
  -- mailvalidation-mcp

Claude Desktop and other MCP clients — add this to the client's MCP config file (for Claude Desktop, claude_desktop_config.json), then restart the app:

{
  "mcpServers": {
    "mailvalidation": {
      "command": "mailvalidation-mcp",
      "env": {
        "MAILVALIDATION_API_KEY": "your-api-key",
        "MAILVALIDATION_TEAM": "your-team-slug"
      }
    }
  }
}

If the client can't find the command, use the full path from which mailvalidation-mcp. Then ask your assistant something like "Check whether sam@gmial.com is a good address." Each address checked uses one validation credit, the same as the API.

Zapier, Make, n8n

Use their generic HTTP request and webhook steps with the REST API and webhooks documented on this page. A step-by-step recipe is on mailvalidation.io/developers.


Embeddable Widget

Add real-time email validation to any website form with a single line of JavaScript. No backend changes needed.

Quick Start

1. Create a widget in your dashboard under Widgets.
2. Copy the embed code and paste it before the closing </body> tag on your site.

<script src="https://app.mailvalidation.io/static/mv/widget.js"
        data-mv-key="YOUR_WIDGET_KEY"></script>

The widget automatically validates all <input type="email"> fields on the page.

Attributes
data-mv-keyRequired. Your widget API key (from the dashboard).
data-mv-validateAdd to any non-email input to opt it into validation.
data-mv-skipAdd to any email input to skip validation.
Widget API Endpoint
POST /api/widget/{widget_key}/validate/

This is the endpoint the widget JS calls. CORS-enabled, no authentication required — the widget key identifies your account.

// Request
POST /api/widget/a1b2c3d4-e5f6-7890-abcd-ef1234567890/validate/
Content-Type: application/json
{"email": "user@example.com"}

// Response
{
  "valid": true,
  "reason": "valid",
  "message": "Email is valid.",
  "suggestion": "",           // only present when we spot a likely typo
  "branding": {
    "text": "Protected by MailValidation.io",
    "url": "https://mailvalidation.io"
  }
}
Widget Response Reasons
validEmail passed all checks
invalid_formatEmail syntax is invalid
invalid_smtpMailbox could not be verified
disposableDisposable email blocked
free_emailFree email provider blocked
role_accountRole account (info@, admin@) blocked
blocked_domainEmail domain is on the widget's Signup Shield block list
blocked_ipVisitor IP is on the widget's Signup Shield block list
limitAccount validation limit reached
Signup Shield

In a widget's settings (Signup Shield) you can list email domains and IP addresses to reject outright, one per line or comma separated. IPs may be single addresses or CIDR ranges (for example 203.0.113.7 or 198.51.100.0/24). The IP checked is the visitor's, as seen by our servers. Blocked attempts return blocked_domain or blocked_ip, never reach the mail-server check, and don't use a validation. Disposable-address blocking is separate and on by default; the disposable-domain list is refreshed weekly.

Typo suggestions

When the domain looks like a typo of a popular provider (gmial.com, hotmial.com, gmail.con, ...), the widget response includes suggestion with the corrected address and the message ends with “Did you mean …?”. The same suggestion is returned as did_you_mean by the validation API. Suggestions are only offered for popular providers, so custom company domains are never “corrected”.


Rate Limits

Authenticated users1,000 requests / hour
Anonymous / unauthenticated100 requests / hour
Widget APINo separate rate limit (counts against your plan's monthly allowance)
Free trial accounts50 validations / hour (the 250 free validations are unchanged, just spread out). Bulk requests are cut down to what's left; single requests return 429 with a Retry-After header. Paid plans are not throttled.

The official SDKs wait and retry automatically on 429 responses.


Webhooks

Configure webhook endpoints to receive notifications when events occur.

Events
bulk_completeFired when a bulk validation upload finishes processing
widget_blockFired when a widget blocks an email submission (validation failure, disposable/free/role rule, or Signup Shield)
domain_blacklistedFired when a monitored sending domain newly appears on a public blocklist (Business+ and Enterprise)
Payload Format
POST https://your-endpoint.com/webhook
Content-Type: application/json
X-MV-Signature: hmac_sha256_hex_digest  (if signing secret is set)

{
  "event": "bulk_complete",
  "data": {
    "bulk_upload_id": 42,
    "filename": "contacts.csv",
    "total": 500,
    "valid": 420,
    "invalid": 80,
    "health_score": 84.0
  }
}
{ "event": "widget_block",
  "data": { "widget_id": 7, "widget_name": "Signup form",
            "email": "user@evil.com", "reason": "blocked_domain" } }

{ "event": "domain_blacklisted",
  "data": { "domain": "mail.example.com", "listed_on": ["dbl.spamhaus.org"] } }

Webhooks are available on Starter plans and above. If a signing secret is set, each request carries an X-MV-Signature header: the hex HMAC-SHA256 of the raw request body using that secret.


Sending-domain monitoring

Business+ and Enterprise plans can monitor up to 25 of their own sending domains against public blocklists. Domains are checked daily, and you can be notified with the domain_blacklisted webhook.

GET/POST /a/{team_slug}/validate/api/monitored-domains/List or add a domain ({"domain": "mail.example.com"})
GET/PATCH/DELETE /a/{team_slug}/validate/api/monitored-domains/{id}/Read, pause (is_active) or remove a domain. Fields include is_listed, listed_on, last_checked_at.

Other plans receive 402.


Ready to get started?

Create Free Account

250 free validations · no credit card required