Email Preflight API API
The Email Preflight API returns pre-send QA for HTML email as clean JSON.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
The primary audit_html endpoint returns HTML validity and warnings, message size with Gmail-clip risk and accessibility issues such as missing alt text — everything you would check before hitting send. You can also test CSS support across clients, compute a spam score, check links and images, verify DNS auth and render a basic preview. It is built for ESPs, marketing tools and QA pipelines that need to catch broken email before it ships. One ReefAPI key, one shared credit pool, the standard envelope.
Real request and response JSON
Captured from the indexed primary action, audit_html, on .
{
"method": "POST",
"url": "https://api.reefapi.com/email-preflight/v1/audit_html",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"html": "<html><body><img src='https://x.test/a.png'><a href='https://x.test'>hi</a></body></html>"
}
}{
"ok": true,
"meta": {
"api": "email-preflight",
"endpoint": "audit_html",
"mode": "live",
"latency_ms": 3.4,
"record_count": 5,
"bytes": 0,
"cache_hit": false,
"proxy_tier_note": "none"
},
"data": {
"html_validity": {
"parse_ok": true,
"warnings": []
},
"size": {
"bytes": 89,
"gmail_clip_risk": false,
"limit_bytes": 102000
},
"accessibility": {
"images_total": 1,
"missing_alt": 1,
"missing_alt_srcs": [
"https://x.test/a.png"
],
"issues": [
"1 image(s) without alt text",
"no lang attribute on the document (screen-reader language hint)"
]
},
"structure": {
"has_doctype": false,
"has_table_layout": false,
"uses_div_layout": false,
"heading_count": 0,
"script_tags": 0,
"link_count": 1,
"image_count": 1
},
"mobile_width_risks": [
"[redacted-phone]"
],
"dark_mode": {
"has_meta_color_scheme": false,
"hints": [
"no <meta name=color-scheme> — clients may auto-invert your colors"
]
},
"tracking_pixels": [],
"external_assets": [],
"unsubscribe": {
"list_unsubscribe_header_present": false,
"has_unsubscribe_link": false,
"has_unsubscribe_text": false
},
"text_part": {
"present": false,
"recommended": true
},
"recommendations": [
{
"severity": "error",
"code": "MISSING_ALT",
"message": "1 image(s) lack alt text — add descriptive alt for accessibility + when images are blocked."
},
{
"severity": "error",
"code": "NO_UNSUB",
"message": "No unsubscribe link/text found — required by CAN-SPAM/CASL and critical for deliverability."
},
{
"severity": "warning",
"code": "NO_DOCTYPE",
"message": "No <!DOCTYPE> — declare one (XHTML 1.0 Transitional is the email-safe default) for predictable rendering."
}
],
"score": {
"value": 46,
"grade": "F"
}
}
}What the Email Preflight API API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| audit_html | Full pre-send structure + accessibility + deliverability lint of an HTML email: missing alt text, broken structure, mobile-width risks, dark-mode hints, tracking pixels, external assets, List-Unsubscribe check, Gmail-clip size budget, and prioritized recommendations. Pure local compute (no network). | Ops teams call audit_html to get full pre-send structure + accessibility + deliverability lint of an HTML email. | html, text_part, base_url, subject, check_links |
| css_support | Email-client CSS/HTML compatibility map for the template (Can-I-Email data, MIT): which CSS features used in the HTML break or degrade in Outlook/Gmail/Apple Mail/Yahoo and friends. Pure local compute (offline snapshot). | Developer tools call css_support to get email-client CSS/HTML compatibility map for the template (Can-I-Email data, MIT). | html |
| spam_score | Deterministic spam-SIGNAL score for the email content (caps ratio, image-to-text ratio, spam phrases, missing unsubscribe, raw-IP links…). HONEST: a content signal score, NOT an inbox-placement prediction; SpamAssassin/Rspamd sidecar = the calibrated upgrade (see docs). Pure local compute. | Validation workflows call spam_score to get deterministic spam-SIGNAL score for the email content (caps ratio, image-to-text ratio, spam…. | html, subject, text_part |
| check_links | Resolve every link in the email through url-resolver (SSRF-guarded): final URL, redirect chain, status, final domain. Bot-403/429 = `unverifiable` (honest — not marked broken). Inner-calls url-resolver per link. | Data-quality teams call check_links to resolve every link in the email through url-resolver (SSRF-guarded). | html, base_url |
| check_images | Audit every <img> in the email: alt text presence, dimensions declared, src scheme/format, http-vs-https, and (best-effort) reachability via url-resolver. Pure-compute by default; reachability adds sub-calls. | Ops teams call check_images to get audit every <img> in the email. | html, base_url, check_reachable |
| dns_auth | Sender-domain email-authentication summary (SPF/DKIM/DMARC/MX + deliverability grade) via an inner-call to the email-health engine — REUSE, not re-implemented here (email-health owns DNS auth; this is a thin preflight wrapper). | Developer tools call dns_auth to get sender-domain email-authentication summary (SPF/DKIM/DMARC/MX + deliverability grade) via an…. | domain, dkim_selector, include_blacklist |
| preview_basic | Basic visual preview: render the HTML to a PNG via web-capture's browser sandbox. HONEST: a browser render, NOT a real email-client render (no Outlook/Word engine). Degrades gracefully if web-capture is not deployed. | Validation workflows call preview_basic to get basic visual preview. | html, width |
Call audit_html from your stack
curl -X POST https://api.reefapi.com/email-preflight/v1/audit_html \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"html":"<html><body><img src='https://x.test/a.png'><a href='https://x.test'>hi</a></body></html>"}'import requests
r = requests.post(
"https://api.reefapi.com/email-preflight/v1/audit_html",
headers={"x-api-key": REEF_KEY},
json={
"html": "<html><body><img src='https://x.test/a.png'><a href='https://x.test'>hi</a></body></html>"
},
)
print(r.json()["data"])const res = await fetch("https://api.reefapi.com/email-preflight/v1/audit_html", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"html": "<html><body><img src='https://x.test/a.png'><a href='https://x.test'>hi</a></body></html>"
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.email-preflight.audit_html with {"html":"<html><body><img src='https://x.test/a.png'><a href='https://x.test'>hi</a></body></html>"}.Who uses this API and why
- ESPs and marketing tools call audit_html to catch broken markup and clipping risk before a send.
- QA pipelines use spam_score and check_links to flag deliverability and broken-link problems.
- Accessibility checks use audit_html to ensure images have alt text and the email is readable.
Questions developers ask before integrating
What is the Email Preflight API API?
Email Preflight API API is a ReefAPI endpoint group for email preflight api It returns live JSON through POST requests under /email-preflight/v1.
Is the Email Preflight API API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. Email Preflight API calls use the same shared credit balance as every other ReefAPI engine.
Do I need a Email Preflight API login or account?
No login to Email Preflight API is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the Email Preflight API data?
The page example is captured from a live audit_html call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the Email Preflight API API use?
Email Preflight API actions currently cost 1-3 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.
Can I call Email Preflight API from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call email-preflight actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the Email Preflight API API a Email Preflight API scraper?
It is the managed alternative to a DIY Email Preflight API scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same email preflight api back as clean JSON.
Why does my Email Preflight API scraper keep getting blocked?
Most Email Preflight API scrapers break on anti-bot defenses, rate limits and IP bans that need rotating residential proxies and browser fingerprinting to clear. ReefAPI handles all of that for you — no proxies, no captchas, no maintenance — and returns live JSON. Blocked or failed calls are free.