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
/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
| Field | Type | Description |
|---|---|---|
is_valid | boolean | Whether the mailbox exists and accepts email (SMTP RCPT TO check) |
valid_format | boolean | Whether the email address syntax is valid (RFC 5322) |
valid_domain | boolean | Whether the domain exists in DNS |
valid_nameserver | boolean | Whether the domain has functioning nameservers |
disposable | boolean | Whether the email is from a known disposable/temporary provider |
is_catch_all | boolean | Whether the domain accepts all email addresses (catch-all) |
is_role_account | boolean | Whether the address is a role account (info@, admin@, support@, etc.) |
is_free_email | boolean | Whether the email is from a free provider (Gmail, Yahoo, Outlook, etc.) |
is_blacklist | boolean | Whether the domain appears on email blacklists |
no_mx | boolean | Whether the domain has no MX records |
dns_timeout | boolean | Whether the DNS lookup timed out |
risk_level | integer 0–5 | Rule-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_mean | string | Suggested corrected address when the domain looks like a typo (e.g. sam@gmial.com → sam@gmail.com). Empty when there is no suggestion. |
quality_score | integer 0–100 or null | Confidence score. Returned on Pro plans and above; null otherwise. |
processing | boolean | Whether 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
201 | Success — email validated |
400 | Invalid request body |
401 | Missing or invalid API key |
402 | Validation limit reached — upgrade your plan |
429 | Rate 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
/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-key | Required. Your widget API key (from the dashboard). |
data-mv-validate | Add to any non-email input to opt it into validation. |
data-mv-skip | Add to any email input to skip validation. |
Widget API Endpoint
/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
valid | Email passed all checks |
invalid_format | Email syntax is invalid |
invalid_smtp | Mailbox could not be verified |
disposable | Disposable email blocked |
free_email | Free email provider blocked |
role_account | Role account (info@, admin@) blocked |
blocked_domain | Email domain is on the widget's Signup Shield block list |
blocked_ip | Visitor IP is on the widget's Signup Shield block list |
limit | Account 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 users | 1,000 requests / hour |
| Anonymous / unauthenticated | 100 requests / hour |
| Widget API | No separate rate limit (counts against your plan's monthly allowance) |
| Free trial accounts | 50 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_complete | Fired when a bulk validation upload finishes processing |
widget_block | Fired when a widget blocks an email submission (validation failure, disposable/free/role rule, or Signup Shield) |
domain_blacklisted | Fired 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.