PristineSend
Get started
API Reference

Deliverability check

Ask "will this land?" before you send. The deliverability check scores email content for spam triggers, deliverability, and engagement issues and returns an actionable verdict — the same analysis behind the dashboard's AI Deliverability Score. It is a pure pre-send check: nothing is sent and no email is logged.

Overview

MethodPathDescription
POST/api/v1/deliverability/checkScore email content; returns a verdict. Does not send.

Requires a key with the deliverability:check scope (a full-access key has it). Checks are unmetered — the same "unlimited scans" as the editor — bounded by the standard per-key rate limit.

Why check before sending

Anyone can generate an email. Whether it reaches the inbox depends on content quality and sender reputation. Run the check in your send pipeline and branch on the verdict — gate on DANGER, surface issues for a human or an agent to fix, then send. Each issue carries a stable code so you can decide programmatically.

The verdict object

FieldTypeDescription
scorenumberOverall deliverability score, 0–100 (higher is better).
verdictstringGOOD, WARNING, or DANGER — a quick gate for send / fix / abort.
summarystringOne-sentence overall assessment.
issuesIssue[]Specific, actionable problems found (see below). Empty when none.
suggestionsstring[]Optional improvement ideas beyond the concrete issues.

Issue

FieldTypeDescription
codestringStable category an agent can branch on: subject, content, structure, or spam.
severitystringhigh, medium, or low.
titlestringShort label for the issue.
descriptionstringWhat the issue is and why it matters.
fixstringConcrete suggestion to resolve it.

Check deliverability

POST/api/v1/deliverability/check

Send a subject and the body as html and/or text. Returns 200 with the verdict. Nothing is sent and no email log row is written.

Request body

FieldTypeRequiredDescription
subjectstringrequiredThe subject line to score.
htmlstringoptionalHTML body to analyze. Provide this and/or text (HTML is preferred).
textstringoptionalPlaintext body. Used when html is omitted. At least one of html/text is required.

Response

"color:#ff7b72">import { PristineSend } "color:#ff7b72">from "pristinesend"

"color:#ff7b72">const ps = "color:#ff7b72">new PristineSend(process.env.PRISTINESEND_API_KEY!)

// A pre-send check — nothing is sent. Decide send / fix / abort "color:#ff7b72">from the verdict.
"color:#ff7b72">const v = "color:#ff7b72">await ps.deliverability.check({
  subject: "Your June invoice is ready",
  html: "<p>Hi — your invoice for June is attached.</p>",
})

console.log(v.score, v.verdict) // e.g. 82 "GOOD"
if (v.verdict === "DANGER") {
  for ("color:#ff7b72">const issue of v.issues) {
    console.log(`[${issue.code}/${issue.severity}] ${issue.title} — ${issue.fix}`)
  }
  // ...fix the content, then send.
}

Errors

All errors use the standard envelope. The codes specific to this endpoint:

StatuscodeWhen
400missing_fieldNo subject, or neither html nor text supplied.
400invalid_fieldsubject/html/text present but not a string.
401unauthorizedMissing or invalid API key.
403insufficient_scopeThe key lacks the deliverability:check scope.
429rate_limitedPer-key rate limit exceeded.
503service_unavailableThe analysis backend is temporarily unavailable — retry.

See the full Error codes reference for the canonical envelope and the complete list.