Docs

Quickstart

One POST /v1/check from your signup handler. Five minutes from key to first verdict.

01Get a key

Sign in with GitHub and your sg_live_ key is on the next screen, with 1,000 checks a month. It is shown once: keep it server-side, in a secret manager. Lost it? Rotate it from your dashboard (the old key keeps working for 24 hours). We run our own check on signups, so a GitHub account younger than 30 days starts with 100 checks a month; talk to the founder for the full free tier or a sg_test_ key for CI.

02First check with curl

Send the end user's email, and their IP if you have it. Only email is required.

terminal
curl -X POST https://api.bouncedmail.dev/v1/check \
  -H "Authorization: Bearer $BOUNCEDMAIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "john.smith+promo@gmail.com", "ip": "81.2.69.142"}'
FieldNotes
emailRequired, 3 to 320 characters.
ipThe end user's IP as your platform's trusted header gives it. Never a raw X-Forwarded-For.
phone, phone_countryAny format; send phone_country (e.g. GB) for national numbers.
user_agentThe browser's user agent string.
form_fill_msRender-to-submit time measured in the browser.
recordDefault true. Send false for on-blur validation: reads, stores nothing.
external_idEchoed back, never stored.

Optional header Idempotency-Key (1 to 64 characters): a retry with the same key and body returns the stored response without counting usage again.

03JavaScript SDK

@bouncedmail/sdk has zero dependencies and runs in Node 18+, Cloudflare Workers, Deno, Bun and Vercel. getClientIp(req, platform) reads the one header each platform sets at its edge: vercel, cloudflare, fly, netlify, express or node.

signup.ts
import { createClient, getClientIp } from "@bouncedmail/sdk";

const bm = createClient({ apiKey: process.env.BOUNCEDMAIL_KEY! });

const verdict = await bm.check({
  email,
  ip: getClientIp(req, "vercel"), // end user's IP
  user_agent: req.headers.get("user-agent") ?? undefined,
});

// Same inbox as an existing account: never create a second one.
if (verdict.suggested_ux === "login_instead") return showLoginInstead();
if (verdict.action === "block") return showNeutralError(verdict.did_you_mean);
if (verdict.action === "challenge") return requireEmailVerification();
// allow: create the account

The npm package is published at launch; until then, copy sdk/index.ts from the repository.

04Act on the verdict

  1. suggested_ux: "login_instead" first. The address reaches the same inbox as an account that was already checked. Show "You already have an account. Log in instead." and don't create a new one. Branch on this before action: an alias farmer owns the inbox, so email verification alone won't stop them.
  2. block: reject with a neutral message; offer did_you_mean if set.
  3. challenge: add one step (verify the email before free credits, Turnstile, a phone).
  4. allow: proceed. Store normalized_email and put a unique index on dedupe_key.

05Response fields

200 application/json
{
  "request_id": "chk_01M8NCH1YV0W7PHS9ARG937691",
  "risk_score": 75,
  "action": "challenge",
  "suggested_ux": "login_instead",
  "reasons": [
    { "code": "duplicate_email", "weight": 70, "strength": "strong",
      "message": "Same mailbox as an account checked before (first checked 3 days ago)." },
    { "code": "plus_alias", "weight": 5, "strength": "flag",
      "message": "Uses a +tag alias; it reaches the same inbox as the address without the tag." }
  ],
  "normalized_email": "johnsmith@gmail.com",
  "dedupe_key": "johnsmith@gmail.com",
  "did_you_mean": null,
  "warnings": []
}
FieldMeaning
risk_score0 to 100. By default 30+ challenges and 70+ with a strong reason blocks.
actionallow, challenge or block.
suggested_ux"login_instead" or null.
reasonsEach with code, weight, strength and a plain-English message.
normalized_email, dedupe_keyThe address to store, and the key that is the same for every alias of one inbox.
did_you_meanA suggested fix for a mistyped domain, or null.
signals, warningsRaw email, IP, phone and velocity signals; non-fatal notes such as dns_unavailable.

06Drop-in examples

Full versions live in examples/ in the repository. Each one branches on suggested_ux first.

import { NextResponse, type NextRequest } from "next/server";
import { createClient, getClientIp } from "@bouncedmail/sdk";

const bm = createClient({ apiKey: process.env.BOUNCEDMAIL_KEY!, timeoutMs: 1500 });
export const config = { matcher: ["/api/signup"] };

export async function middleware(req: NextRequest) {
  if (req.method !== "POST") return NextResponse.next();
  const body = await req.clone().json().catch(() => null);
  if (typeof body?.email !== "string") return NextResponse.next();

  const verdict = await bm.check({ email: body.email, ip: getClientIp(req, "vercel") });

  if (verdict.suggested_ux === "login_instead")
    return NextResponse.json({ error: "account_exists" }, { status: 409 });
  if (verdict.action === "block")
    return NextResponse.json({ error: "signup_rejected", did_you_mean: verdict.did_you_mean }, { status: 422 });

  const headers = new Headers(req.headers);
  headers.set("x-bouncedmail-action", verdict.action); // challenge: verify email before free credits
  return NextResponse.next({ request: { headers } });
}

07Failures and errors

The SDK never breaks your signup form, and it doesn't fail open to a flood either:

What happenedSDK returns
Timeout (1,500 ms), network error, 5xxallow with error set
429 rate_limited or quota_exceededchallenge (these mostly happen during a flood)
Other 4xx (e.g. a revoked key)allow with error: "client"; watch your logs

API errors look like {"error": {"code", "message", "request_id"}}: 400 invalid_json, 401 missing_api_key / invalid_api_key, 403 insufficient_scope, 413, 415, 422 validation_error, 429 rate_limited / quota_exceeded (with Retry-After), 503 unavailable. An invalid email is not an error: it is a 200 with email_invalid_syntax.

08Limits

  • Monthly quota per plan (free 1,000, Starter 20,000, Growth 100,000, Scale 500,000). Up to 2× still works with a quota_grace warning. Every 200 carries X-Quota-Limit, X-Quota-Used and X-Quota-Reset.
  • Bursts: 500 requests per 10 seconds per key.
  • Test keys (sg_test_) run every check but store nothing, up to 1,000 checks a month.
  • Server-side only: there are no CORS headers. Base URL: https://api.bouncedmail.dev.

09What we store

No raw email, IP, phone number or user agent is stored or logged. Repeat-account memory, velocity counters and phone links are keyed hashes (HMAC-SHA256 under a server secret and your account's salt), kept for 90 days by default (30 to 365, configurable); velocity counters expire within 24 hours. DELETE /v1/subjects erases one mailbox (every alias of it) from your account. Domain-age lookups send only the email's domain to that TLD's RDAP registry and can be switched off.

Your own BouncedMail account. When you sign in with GitHub we keep your GitHub id, username, name, primary verified email, plan, the verdict of our own check on your signup, and when you signed up. Not your GitHub token (revoked right after sign-in) or your repositories; your IP and browser only as the same short-lived keyed hashes our check keeps for every customer. Your API key is stored only as a hash. Want it all deleted? Talk to the founder.

10List sources

Disposable domains: disposable-email-domains (CC0), disposable/disposable-email-domains (MIT), 7c/fakefilter (BSD-3). Free providers: willwhite/freemail (ISC). Universities: Hipo university-domains-list (MIT). IP ranges published by AWS, Google Cloud, Azure, Oracle Cloud, DigitalOcean and Apple (iCloud Private Relay); IP to ASN: IPtoASN (PDDL); Tor exits: the Tor Project's bulk exit list.

11Talk to the founder

BouncedMail is built and run by one founder, who answers every message personally: paid plans and custom quotas, a signup our own check turned away, a starter quota you'd like lifted, a false positive, or a question before you integrate.

A booking link for a 20-minute call goes here shortly. Until then: every signup, including one our check turned away, lands on the founder's review list, and the founder writes to the primary email of your GitHub account. There's nothing else you need to send.