Email Preflight API
Email Preflight API
/email-preflight/v1/audit_html2 creditsFull 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).
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
| text_part | optional | — | Optional plain-text alternative of the email. If omitted, the audit flags the missing multipart/alternative text part. |
| base_url | optional | — | Optional base URL: relative links/images in the HTML are resolved against it before checking. |
| subject | optional | — | Optional subject line — included in the spam-signal analysis. |
| check_links = false | optional | — | If true, audit_html ALSO resolves every link via url-resolver (adds latency + a sub-call per link). Default false = static lint only. |
/email-preflight/v1/css_support1 creditEmail-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).
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
/email-preflight/v1/spam_score1 creditDeterministic 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.
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
| subject | optional | — | Optional subject line — included in the spam-signal analysis. |
| text_part | optional | — | Optional plain-text alternative of the email. If omitted, the audit flags the missing multipart/alternative text part. |
/email-preflight/v1/check_links2 creditsResolve 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.
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
| base_url | optional | — | Optional base URL: relative links/images in the HTML are resolved against it before checking. |
/email-preflight/v1/check_images1 creditAudit 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.
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
| base_url | optional | — | Optional base URL: relative links/images in the HTML are resolved against it before checking. |
| check_reachable = false | optional | — | If true, HEAD/GET each image via url-resolver to confirm it loads (adds latency + sub-calls). |
/email-preflight/v1/dns_auth1 creditSender-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).
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| domain | required | — | The sending domain (the From: address domain). Its email authentication (SPF/DKIM/DMARC/MX) is summarized via email-health. |
| dkim_selector | optional | — | Optional DKIM selector to look up (e.g. 'google', 's1'). If omitted, email-health autoscans common selectors. |
| include_blacklist = false | optional | — | Also run the slower DNSBL reputation pass (email-health blacklist). Default false = auth-only (SPF/DKIM/DMARC/MX), the fast pre-send check. |
/email-preflight/v1/preview_basic3 creditsBasic 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.
| Parameter | Allowed / range | Description | |
|---|---|---|---|
| html | required | — | The full HTML of the email you are about to send (paste the source). Parsed read-only in a no-network, no-script sandbox. |
| width = 600 | optional | 320–1200 | Viewport width in px (typical email width = 600). |
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>"}'{
"ok": true,
"data": { /* the result */ },
"meta": {
"latency_ms": 240,
"record_count": 12,
"completeness_pct": 100
},
"error": null
}