API guide
Validate email addresses with JavaScript
The ValidatedMails API evaluates email validity and routing capability using syntax, DNS, and SMTP signals. Responses include the verdict outcome, confidence score, and a trace identifier.
Overview
Use /validate to assess whether an email address is valid, invalid, or unknown. Each response includes status, is_valid, score, and atrace_id for auditing and support.
Run the standalone JavaScript quickstart
Download the runnable example. Set VALIDATEDMAILS_API_KEY privately in your environment, then run node validate-email.mjs for a free connection check. Add --email ADDRESS for one validation using an address you are authorized to verify. Valid, risky, and invalid results cost one credit; unknown is free. Requests are bounded to 60 seconds and are never automatically retried.
For assistant tools, use the MCP setup guide.
Quickstart
Call /validate with a simple GET request or a POST request using JSON. Use whichever matches your runtime.
GET https://api.validatedmails.com/validate/?email=ada@acme.com&token=YOUR_API_TOKENPOST https://api.validatedmails.com/validate?token=YOUR_API_TOKEN
Content-Type: application/json
{
"email": "ada@acme.com"
}JavaScript examples (fetch)
Use fetch with async/await and parse JSON directly. The examples below show GET and POST styles with minimal transport error handling.
const API_BASE_URL = process.env.VITE_API_BASE_URL ?? 'https://api.validatedmails.com';
const API_TOKEN = process.env.VALIDATEDMAILS_API_TOKEN ?? 'YOUR_API_TOKEN';
async function validateEmailGet(email) {
const url = new URL('/validate/', API_BASE_URL);
url.searchParams.set('email', email);
url.searchParams.set('token', API_TOKEN);
let response;
try {
response = await fetch(url);
} catch (error) {
throw new Error('Network error');
}
if (!response.ok) {
throw new Error(`Request failed (${response.status})`);
}
return response.json();
}
const result = await validateEmailGet('ada@acme.com');
const { status, is_valid, score, trace_id } = result;
console.log('status:', status);
console.log('is_valid:', is_valid);
console.log('score:', score);
console.log('trace_id:', trace_id);
if (status === 'valid') {
console.log('Accept signup');
} else if (status === 'invalid') {
console.log('Reject signup');
} else {
console.log('Risky or unknown: apply your review or confirmation policy');
}const API_BASE_URL = process.env.VITE_API_BASE_URL ?? 'https://api.validatedmails.com';
const API_TOKEN = process.env.VALIDATEDMAILS_API_TOKEN ?? 'YOUR_API_TOKEN';
async function validateEmailPost(email) {
const url = new URL('/validate', API_BASE_URL);
url.searchParams.set('token', API_TOKEN);
let response;
try {
response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email }),
});
} catch (error) {
throw new Error('Network error');
}
if (!response.ok) {
throw new Error(`Request failed (${response.status})`);
}
return response.json();
}
const result = await validateEmailPost('ada@acme.com');
console.log(result);Sample response payload:
{
"is_valid": true,
"status": "valid",
"score": 95,
"smtp_ok": true,
"accept_all": false,
"disposable": false,
"role": false,
"free": false,
"tag": false,
"mx_ok": true,
"a_ok": true,
"trace_id": "..."
}Response usage
status + is_valid
- valid: routing and SMTP evidence support acceptance.
- invalid: syntax or SMTP response indicates rejection.
- risky: review catch-all and other risk signals under your acceptance policy.
- risky: review catch-all and other risk signals under your acceptance policy.
- unknown: no deterministic outcome from routing or SMTP signals.
is_valid is a convenience mirror for status === "valid". Usestatus for four-state verdict routing.
score + trace_id
score is a 0-100 confidence indicator used to rank risk alongside flags. Log trace_id with request metadata for support and audit trails.
Handling outcomes
- valid: allow access or proceed with onboarding.
- invalid: block the address and request correction.
- risky: review catch-all and other risk signals under your acceptance policy.
- risky: review catch-all and other risk signals under your acceptance policy.
- unknown: route to confirmation, review, or a secondary flow.
Transport failures
For HTTP 429, honor Retry-After when present. After a timeout or connection loss, review before resending: processing and charging may already have completed. A response withstatus is a completed outcome.
Integration patterns
Gating signups
- Accept
validin real time. - Reject
invalidto prevent hard bounces. - Route
unknownto confirmation or review.
Form submissions
- Validate immediately before submitting.
- Surface validation feedback alongside the email field.
Batch scripts & workers
- Use
POST /validate/batchfor email lists and background workers. - Run parallel batch workers to reach your target throughput.
- Use Bulk validation jobs for very large CSV imports and full-list processing.
- Segment
unknownresults for follow-up checks.