Mailbeam
Email Validation ApiBy The Mailbeam Team18 min read6 September 2026

Email Validation API Reference Guide for Developers

An email validation API is a developer endpoint that returns validity, a score, and a machine-readable reason for a submitted address, designed to be called synchronously during signup. A practical pipeline runs syntax checks first, then DNS and MX checks, and uses SMTP probing only when cheaper checks pass, because syntax checks complete in microseconds, DNS and MX lookups typically take about 10–50 ms, and SMTP verification can take roughly 500 ms to several seconds (validation pipeline guidance).

The problem usually appears during an ordinary registration flow. A user mistypes an address, a bot submits a disposable mailbox, or a legitimate business user enters a shared role account. Your application stores the value, sends a confirmation message, and only later discovers that the address was never usable. By then, the bad record has reached authentication, CRM, marketing, and transactional systems.

A well-designed API prevents that handoff from becoming guesswork. It gives your product a structured decision, your backend a stable contract, and your compliance team a defined processing and deletion model.

Table of Contents

What an Email Validation API Does and Where It Fits

An email validation API sits between the form submission and the systems that depend on a usable address. During signup, your backend sends one address and receives a synchronous result. During list hygiene, a worker submits many addresses asynchronously and stores the resulting classifications for later campaign decisions.

The checks should run in layers:

  1. Syntax validation rejects malformed input before any network call.
  2. DNS and MX validation checks whether the domain is configured to receive mail.
  3. Disposable-domain detection identifies temporary mailbox providers.
  4. Role-based detection flags shared addresses such as support or postmaster accounts.
  5. SMTP probing tests mailbox-level acceptance or catch-all behavior when deeper evidence is justified.

That order matters. RFC-compliant validation guidance distinguishes what each layer proves. Syntax only establishes that an address is parseable. DNS and MX checks establish domain-level mail capability. SMTP probing can provide mailbox-level acceptance signals, but an accept-all domain remains less certain than a confirmed mailbox.

A diagram illustrating a five-step email validation pipeline flow, starting from syntax checks to smtp handshakes.

Practical rule: use the shallowest check that supports the product decision. Signup needs responsive feedback. A dormant marketing list can tolerate deeper, asynchronous analysis.

The API is a contract, not just a remote regex. Your product commits to interpreting a verdict and reason code. The provider commits to response semantics, freshness signals, and predictable behavior when a remote mail server is slow or deliberately vague. That contract must work across authentication, list imports, outbound suppression, and retention controls.

Deliverability makes this discipline measurable. Industry benchmarks commonly treat a hard-bounce rate below 1% as healthy and a total bounce rate below 2% as acceptable, while 2%–5% is generally warning or danger territory (email bounce-rate benchmarks). In a 2025 outbound dataset covering 7.5 million emails, 128,605 bounced, producing a 1.71% bounce rate and an implied 98.29% delivery rate, which illustrates why validation at collection is preferable to discovering decay after sending.

Inside the Real-Time Verification Endpoint

The real-time endpoint should accept one address and return enough context for a handler to make a decision without parsing prose. A typical request uses POST /v1/verify with a JSON body containing email. An optional ip_address or signup-context field may support fraud policy, but the verifier should process only the email field unless additional data is necessary.

A production client should set a deadline. If SMTP probing exceeds that budget, the API should return an explicit unknown or timeout result rather than converting uncertainty into invalidity. A cache indicator, such as cache_hit, also matters because a cached DNS result and a fresh SMTP observation don't have the same freshness characteristics.

Response fields that belong in the contract

Field Type Meaning
status string Product-level classification, such as valid, invalid, risky, or unknown
valid boolean Coarse validity signal for simple consumers
normalized_email string Canonicalized address returned by the provider
score number Provider confidence or risk score
reason string Canonical machine-readable reason code
is_role boolean Whether the local part appears to represent a shared role
is_disposable boolean Whether the domain appears temporary or disposable
has_mx boolean Whether the domain has usable mail exchange records
smtp_status string SMTP connection or acceptance result
cache_hit boolean Whether the result came from a cached observation
request_id string Correlation identifier for support and incident analysis

The status enum should describe a business decision, not expose raw protocol behavior. valid can pass through signup. invalid can block immediately. risky may continue through a confirmation step. unknown should usually defer the decision, especially when the cause is a timeout or greylisting event.

A provider's real-time email verification API should document whether normalization changes case, whitespace, or Unicode representation, and whether it preserves the original input for audit purposes. Don't treat normalization as proof of deliverability. It only gives downstream systems a consistent key.

Request and Response Walkthrough

A signup handler should make one bounded call before creating the account or sending a verification message. The exact host and authentication scheme depend on the provider, but the shape should remain simple:

curl -X POST "https://api.example.com/v1/verify" \
  -H "Authorization: Bearer $EMAIL_VERIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"person@example.com"}'

A useful response has a stable field order for logs and tests, even though JSON object order isn't semantically significant:

{
  "status": "risky",
  "valid": true,
  "normalized_email": "person@example.com",
  "score": 72,
  "reason": "accept_all",
  "is_role": false,
  "is_disposable": false,
  "has_mx": true,
  "smtp_status": "accepted",
  "cache_hit": false,
  "request_id": "req_123"
}

The important detail is the reason, not the boolean. A catch-all response means the domain accepted the probe, but the server didn't prove that the specific mailbox exists. That should produce a different user experience from invalid_format, even if both affect confidence.

Use the reason code as a switch:

  • valid or smtp_ok, allow signup and continue normally.
  • invalid_format or no_mx_record, reject with an inline correction prompt.
  • accept_all, greylisted, or connection_timeout, capture the signup but defer high-value mail.
  • disposable_domain, block or request a durable address according to the product's policy.
  • role_based, allow when shared business inboxes are legitimate, but mark the account for messaging controls.

Screenshot from https://example.com/screenshots/email-validation-api-request-response.png

In Node, keep the verification call inside a service with a deadline and typed response. In Python, use the same pattern with a session-level timeout and a retry policy limited to transient outcomes. The signup controller shouldn't know how SMTP works. It should receive a normalized result and choose an outcome.

The Mailbeam quickstart documentation is the appropriate place to map a provider-specific request shape into this service boundary. Keep provider keys server-side, log the request ID, and never expose the full provider response directly in a public form error.

Reason Codes Reference by Check Layer

Reason codes are operational telemetry. If no_mx_record rises suddenly, investigate domain resolution or a source-quality problem. If connection_timeout rises, inspect provider reachability, network behavior, or the remote domains being checked. A boolean hides those distinctions.

Syntax and domain checks

Reason code Meaning Default handling
invalid_format The address can't be parsed safely Hard-block and ask for correction
empty_address No usable address was submitted Hard-block
no_mx_record The domain lacks a usable MX path Hard-block
no_mail_route Neither MX nor a fallback mail route is available Hard-block
dns_error DNS resolution failed in a way that may be transient Retry, then defer
domain_not_found The domain doesn't resolve Hard-block unless the provider marks the result transient

Syntax errors are deterministic. DNS errors aren't always. Your handler should preserve that difference so an infrastructure incident doesn't become a wave of false signup rejections.

Disposable and role classifications

disposable_domain identifies a temporary mailbox service. Most consumer signup flows should block it or request another address, while an internal testing environment may allow it.

role_based identifies addresses such as info@, support@, or postmaster@. It isn't a deliverability failure. A business product may accept these addresses, but it can suppress personal onboarding assumptions and avoid treating the mailbox as a single user's private channel.

free_provider is a policy signal, not a rejection reason. Consumer products often need to accept free-provider addresses. Regulated or business-only workflows may use it as part of a review rule, but shouldn't equate it with fraud.

SMTP outcomes

  • smtp_ok means the remote exchange accepted the mailbox-level probe. Allow, subject to other policy checks.
  • mailbox_full indicates a delivery risk that may be temporary. Accept the account, suppress immediate nonessential sends, and retry later.
  • accept_all means the domain accepts arbitrary recipients. Treat it as risky, not invalid.
  • greylisted means the remote server temporarily deferred the probe. Retry asynchronously rather than blocking a legitimate signup.
  • connection_timeout means the probe didn't finish within the provider's budget. Defer or use a lower-confidence path.
  • tls_required means the remote server requires a secure SMTP negotiation. Retry with the provider's supported secure path, then classify as unknown if it still can't complete.
  • smtp_rejected means the remote server rejected the recipient or session. Combine it with the provider's confidence and other checks before blocking.

Score and aggregation outcomes

Use valid, risky, invalid, and unknown as aggregate statuses. The numeric score is useful for analytics and cohort policy, but reason codes should drive deterministic branches. A score without an explanation is difficult to defend to support teams and difficult to audit under a data-minimization policy.

Latency Profiles Across Verification Paths

Verification depth is a product choice. Syntax validation is effectively immediate. DNS and MX lookups typically take about 10–50 ms, while SMTP checks require a live remote session and may take roughly 500 ms to several seconds (layered email validation timings).

A cached DNS-only path is suitable for an early signup response when the user experience can't tolerate a remote SMTP wait. It catches malformed domains and domains without mail routing, but it can't prove that a mailbox still exists on a functioning domain. A full SMTP path offers stronger evidence, but remote greylisting and connection behavior make its completion time less predictable.

A bar chart comparing latency speeds for different email verification methods including cached DNS, syntax reputation, and full SMTP.

A timeout should produce uncertainty, not a fabricated failure.

Use the fast path for ordinary registration when the main goal is to stop obvious bad data. Use deeper verification for re-engagement campaigns, high-value transactional messages, or addresses already showing delivery risk. A practical design lets the first request return a decision and queues a deeper check when the result is ambiguous.

The cost trade-off also matters. A provider may price deep probes differently from cached checks, and SMTP sessions consume more operational capacity. Don't make the signup endpoint pay the maximum verification cost for every address. Let policy choose the depth.

Batch and Asynchronous Endpoints for List Hygiene

Batch verification solves a different problem from signup gating. A list-cleaning job can wait for retries, inspect every row, and produce a downloadable result without holding a browser request open.

A conventional contract looks like this:

  1. POST /v1/batches accepts CSV or a JSON array and returns a batch_id.
  2. GET /v1/batches/{id} reports queued, processing, completed, or failed state.
  3. A results endpoint returns a signed download URL when processing completes.
  4. A webhook delivers the completion event so your worker doesn't poll forever.

Don't tight-loop the status endpoint. Poll at a relaxed interval, or configure a webhook and verify its signature against the raw request body before updating the batch state. The uploaded file should have a documented deletion window. GDPR-oriented provider guidance commonly describes batch-file deletion after roughly 72 hours, with transactional logs often retained 30–90 days and audit records potentially retained 3–7 years, depending on legal obligations (GDPR email verification guidance).

A runbook entry can be as simple as:

  • Upload a stale list with an idempotency key.
  • Store the returned batch_id, source name, and request ID.
  • Wait for the signed completion webhook.
  • Download per-row status, score, and reason.
  • Suppress invalid addresses, review risky rows, and delete local temporary files according to your retention policy.

Don't use a batch result as permanent truth. Mailbox status changes, and a result is evidence from a particular processing event. Store only the fields needed for the decision you must explain, and preserve the provider's timestamp if your audit process requires it.

Turning Reason Codes into Product Decisions

Your product has three useful outcomes: allow the signup, block it, or capture the user and defer a high-risk action. The API's raw response becomes valuable only after you map each reason family to one of those outcomes.

Reason family Signup outcome User-facing behavior Messaging policy
invalid_format Block Ask the user to correct the address Send nothing
no_mx_record Block or correction Explain that the domain can't receive mail Send nothing
smtp_ok Allow Continue normally Permit standard sends
role_based Allow with flag Avoid implying a personal mailbox Limit personal workflows if needed
mailbox_full Capture and defer Don't expose remote diagnostics Retry before important sends
accept_all Capture and defer Request confirmation when appropriate Use low-priority confirmation
greylisted Capture and defer Keep the form successful Retry asynchronously
connection_timeout Capture and defer Avoid blaming the user Recheck before critical mail
disposable_domain Block or review Ask for a durable address Suppress standard sends

The UI should say “Enter a valid email address” or “We couldn't confirm this address yet.” It shouldn't display SMTP response text, internal reason names, provider hostnames, or a score that the user can't interpret.

A flowchart showing how reason codes from verification checks map to automated product decisions like allow, block, or defer.

A compact handler can return a stable localization key:

if reason in ["invalid_format", "no_mx_record", "no_mail_route"]:
    return BLOCK, "email.correct_address"

if reason in ["disposable_domain"]:
    return BLOCK, "email.use_durable_address"

if reason in ["mailbox_full", "accept_all", "greylisted", "connection_timeout"]:
    return DEFER, "email.confirmation_pending"

return ALLOW, "email.accepted"

Treat false positives as a product cost. Independent comparison content reports tested-vendor results ranging from 99.1% accuracy with 0.4% false positives to 97.1% accuracy with 2.1% false positives (email verification API comparison). That variation is why ambiguous outcomes need a route other than “reject.”

Authentication, Quotas, and Account Controls

The operational contract starts before the first request. Issue separate keys for development, staging, and production, scope them to the minimum required permissions, and rotate them without taking the signup flow offline. A browser-exposed token should never carry the authority of a server credential.

Your provider should document:

  • Key scope, including environment and endpoint permissions.
  • Quota accounting, including whether rejected and retried checks consume usage.
  • Rate behavior, including sustained limits and burst handling.
  • Over-limit responses, with a consistent 429 body and Retry-After header.
  • Dashboard freshness, so operators know whether usage is current or delayed.
  • Failure policy, including whether the API fails open, fails closed, or returns unknown.
Plan Auth Monthly checks Rate limit Overage SLA
Development Scoped test key Documented by provider Low burst allowance Usually disabled Best effort
Production Rotatable server key Contract-defined Signup-safe sustained limit Contract-defined Published tier
Enterprise Scoped keys and controls Negotiated Custom burst policy Negotiated Custom terms

Don't invent retry behavior in application code. Honor Retry-After for throttling, use idempotency keys for retried submissions, and record whether a response was a cache hit. The authentication documentation should be treated as part of the integration contract, not as optional setup material.

GDPR, Data Residency, and Retention Details

An email address becomes personal data in many contexts as soon as a user submits it. Verification therefore belongs in the same privacy review as account creation, not in a later marketing checklist. GDPR Article 5(1)(e) requires personal data to be kept no longer than necessary, which makes provider retention terms directly relevant to API design.

For a Data Protection Impact Assessment, document four boundaries:

  1. Input minimization. Send the email field and only additional context that has a documented purpose.
  2. Processing location. Record where the API request, SMTP probing, logs, and batch queue operate.
  3. Retention. State when single checks, uploaded files, result files, logs, and stored reason codes are deleted.
  4. Erasure behavior. Ensure a deleted account can't be reintroduced by a cached result or an old batch export.

A real-time check can be designed as ephemeral processing, with the result returned and the address not retained beyond the response. Batch processing needs a queue, temporary storage, signed downloads, and a deletion job. Provider guidance commonly describes immediate deletion for single-address verification and deletion of batch-upload files after roughly 72 hours, but your contract should state the exact event that starts the clock.

Compliance rule: a DPA isn't a substitute for a retention schedule. Your application still needs to decide what it stores and why.

Signup verification and list hygiene may have different lawful-basis analyses. A signup check can be necessary to provide the requested account service. A marketing-list cleanup may involve a different purpose, especially if you store scores or reason codes beside contact records. SMTP probing and risk scoring can also raise profiling and cross-border transfer questions, so document subprocessors and residency rather than assuming “validation” is automatically low risk.

Free Web Utilities for Triage and Debugging

Browser-based tools are useful when an engineer needs to inspect one address without writing a script. They can expose the same practical categories your API returns, including syntax, MX behavior, disposable classification, role signals, and SMTP uncertainty.

A disciplined incident loop looks like this:

  • Capture the failure. Save the signup request ID, provider result, and application decision.
  • Replay safely. Test the address in a diagnostic utility without exposing unrelated customer data.
  • Compare layers. Check whether the failure came from syntax, DNS, disposable detection, or an SMTP outcome.
  • Reconcile policy. Confirm that the UI response matched the canonical reason-code mapping.
  • Record the fix. Update the handler or provider escalation notes, rather than adding a one-off exception.

Web utilities shouldn't replace authenticated API calls in production. They don't provide the same idempotency, observability, batch controls, or deployment guarantees. Their value is forensic. Support teams can reproduce a reported bounce, backend engineers can compare a live result with stored logs, and operations teams can investigate a domain without spending a production quota unit or exposing an API key.

Quick Reference Card

Use the shallowest endpoint that answers the current question. Signup flows need a bounded synchronous response. List maintenance needs asynchronous processing and row-level results. Incident triage needs a diagnostic surface that doesn't alter production state.

Endpoint Method Typical latency Primary use
/v1/verify POST Fast for syntax and DNS, slower with SMTP Signup gating and transactional preflight
/v1/verify?mode=dns POST DNS lookup generally about 10–50 ms Low-latency domain screening
/v1/batches POST Immediate job creation, processing asynchronous Submit a CSV or address list
/v1/batches/{id} GET Fast status response Check batch progress
/v1/batches/{id}/results GET Fast signed-URL response after completion Download row-level decisions
/v1/webhooks/verification POST Event delivery dependent on queue state Receive completion notifications

For every endpoint, standardize the authorization header, request ID, idempotency behavior, timeout policy, and retention expectation in your internal runbook. Keep signup decisions deterministic, treat transient SMTP responses as uncertainty, and make deletion part of the integration rather than an administrative afterthought.


Mailbeam provides a real-time email verification API with structured validity, scoring, and reason outputs for signup flows, alongside asynchronous tooling for list maintenance and diagnostic web utilities. If you're building an EU-focused onboarding or deliverability workflow, visit Mailbeam to review the API and verification tools.