{"uid":"cap_24U0xtD3SnDESJ6XwCg7d","slug":"agent-preflight-apis-email-html-validator-fbca8b79","name":"Agent Preflight APIs – Email HTML Validator","description":"Pre-action x402 payment checks and deterministic email HTML validation for AI agents.","url":"https://email-preflight-api.vercel.app/api/preflight","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"html":{"type":"string","maxLength":512000,"minLength":1,"description":"One complete email HTML source document, up to 512,000 UTF-8 bytes. Do not include subscriber data."}}},"responseSchema":{"type":"json","example":{"ok":true,"issues":[],"metrics":{"links":1,"images":0,"commentBytes":0,"styleBlockBytes":0,"imagesWithoutAlt":0,"inlineStyleBytes":0,"scriptBlockBytes":0,"embeddedBase64ImageBytes":0},"service":"email-preflight","version":"2026-07-31","clipping":{"risk":"low","htmlBytes":88,"headroomBytes":102312,"thresholdBytes":102400,"percentOfThreshold":0.1},"limitations":["This is deterministic source analysis, not inbox-placement or rendering testing.","Merge tags and platform-added footer content can change final message size.","A missing issue does not guarantee compatibility with every email client."]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5TJtMM73XoJZPR_qaryM_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Deterministically validates email HTML for deliverability issues, clipping risk, and compatibility problems before an agent sends a campaign or transactional message.","exampleAgentPrompt":"Before I send this email campaign, check the HTML for clipping risk, missing alt text, inline style issues, and any other compatibility problems — here's the HTML: '<html><body><h1>Hello!</h1></body></html>'.","exampleUseCases":[{"title":"Pre-send campaign clipping check","prompt":"I'm about to send this newsletter HTML to 10,000 subscribers — can you run it through the email preflight validator to see if it's at risk of being clipped by Gmail and flag any other issues? Here's the HTML."},{"title":"Transactional email QA in agent workflow","prompt":"My agent just generated an order confirmation email. Before it sends, validate the HTML for missing alt text on images, embedded scripts, oversized style blocks, and clipping risk."},{"title":"Bulk template audit before deployment","prompt":"I have a new email template I want to deploy — check the HTML for compatibility issues like inline styles, base64 images, script blocks, and tell me how close it is to the 102,400 byte clipping threshold."}],"resultDescription":"Returns a JSON object with an 'ok' boolean, a list of detected issues, detailed metrics (link count, image count, inline style bytes, script block bytes, comment bytes, base64 image bytes, images without alt text), a clipping risk assessment (risk level, HTML byte size, headroom, threshold, percent of threshold), service name, version, and a limitations disclaimer. An empty issues array with ok:true means no problems were detected.","failureModes":["Malformed or non-HTML input may return validation errors or unexpected issue lists","Very large HTML payloads may be rejected or return clipping risk as high","Payment failure via x402 protocol results in a 402 response before analysis begins","Dynamic merge tags and platform-injected footer content are not accounted for in byte size calculations","Results reflect static source analysis only — actual inbox rendering may differ"],"whenToPreferThis":"Use this endpoint when an AI agent is about to send an email and needs a fast, deterministic, pre-send sanity check on raw HTML — specifically to catch Gmail clipping risk (>102KB), missing alt text, embedded scripts, bloated style blocks, or base64 images before they reach an inbox. Prefer this over manual review or full inbox-placement testing services when you need a cheap ($0.01), programmatic, no-side-effect check that runs inline in an agentic workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:39:13.028Z","isFirstParty":false}