Check API (signup firewall)

GET /check/email and /check/domain return an allow, review or block verdict with machine-readable reasons, plus per-account block/allow rules, check logs and stats.

The Check API is a signup firewall. Call it from your server when someone signs up (or changes their email) and it returns one verdict — allow, review or block — with the reasons behind it. It catches:

  • Disposable addresses — the domain is on Piisend’s disposable blocklist, or its MX hosts belong to known throwaway-mail infrastructure.
  • Forwarded / masked addresses — relay services such as SimpleLogin or addy.io.
  • Typos — jane@gmial.com comes back with did_you_mean: "jane@gmail.com".
  • Spammy or dead domains — phishing or spam-listed domains, domains with no MX records, and domains registered less than 30 days ago.
  • Repeat bad actors — your own block/allow rules (by email, domain or mail server) are applied to every check, and every check is logged for 30 days so you can see who keeps coming back.

Base URL: https://api.piisend.com/api/v1. Call it server-side only — never ship your API key to a browser or mobile app.

Quickstart

  1. Create an API key in the dashboard under API → Keys. Keys created with the default scopes include check:read and check:write. If you pick scopes yourself, include check:read (or check:write, which implies it).
  2. Store it as PIISEND_API_KEY on your server.
  3. Call GET /check/email/{email}. URL-encode the address: a literal + must reach the API as + or %2B (path parameters are not form-decoded, so an unencoded + sent by some clients as a space will fail).
bash
1curl -s "https://api.piisend.com/api/v1/check/email/jane.doe%2Bnews@gmail.com" \
2 -H "Authorization: Bearer $PIISEND_API_KEY"
javascript
1// Node 18+ (server only)
2const email = "jane.doe+news@gmail.com";
3const res = await fetch(
4 `https://api.piisend.com/api/v1/check/email/${encodeURIComponent(email)}`,
5 { headers: { Authorization: `Bearer ${process.env.PIISEND_API_KEY}` } },
6);
7if (!res.ok) throw new Error(`Check failed: ${res.status}`);
8const check = await res.json();
9console.log(check.recommendation, check.reasons, res.headers.get("X-Checks-Remaining"));
python
1import os
2from urllib.parse import quote
3
4import requests
5
6email = "jane.doe+news@gmail.com"
7r = requests.get(
8 f"https://api.piisend.com/api/v1/check/email/{quote(email, safe='@')}",
9 headers={"Authorization": f"Bearer {os.environ['PIISEND_API_KEY']}"},
10 timeout=5,
11)
12r.raise_for_status()
13check = r.json()
14print(check["recommendation"], check["reasons"], r.headers.get("X-Checks-Remaining"))

Example response (values illustrative):

json
1{
2 "email": "jane.doe+news@gmail.com",
3 "normalized_email": "janedoe@gmail.com",
4 "domain": "gmail.com",
5 "disposable": false,
6 "disposable_reason": null,
7 "disposable_provider": null,
8 "public_domain": true,
9 "relay_domain": false,
10 "spam": false,
11 "phishing": false,
12 "mx": true,
13 "mx_records": [
14 { "priority": 5, "host": "gmail-smtp-in.l.google.com" },
15 { "priority": 10, "host": "alt1.gmail-smtp-in.l.google.com" }
16 ],
17 "spf": true,
18 "dmarc": true,
19 "domain_age_in_days": 11431,
20 "domain_created_at": "1995-08-13T04:00:00Z",
21 "did_you_mean": null,
22 "recommendation": "allow",
23 "reasons": [],
24 "account_rule": null,
25 "role_account": false,
26 "alias": true
27}

A disposable address for comparison:

json
1{
2 "email": "test@mailinator.com",
3 "disposable": true,
4 "disposable_reason": "blocklist",
5 "recommendation": "block",
6 "reasons": ["disposable"],
7 "...": "other fields omitted"
8}

Domain check

GET /check/domain/{domain} runs the same domain signals without a mailbox. Use it when you only have a domain (for example, an SSO or company-domain field).

bash
1curl -s "https://api.piisend.com/api/v1/check/domain/mailinator.com" \
2 -H "Authorization: Bearer $PIISEND_API_KEY"
3
4# Skip the MX lookup
5curl -s "https://api.piisend.com/api/v1/check/domain/example.com?include_mx=false" \
6 -H "Authorization: Bearer $PIISEND_API_KEY"
Query parameterTypeDefaultMeaning
include_mxbooleantrueWhen false, MX records are not looked up: mx is null, mx_records is [], the no_mx reason can’t fire, disposable detection uses the blocklist only (no MX-infrastructure match), and mx_host account rules can’t match.

If you pass something that looks like an email address to the domain endpoint, only its domain part is checked. Email checks always look up MX.

Response reference

Both endpoints return the same domain fields. Email checks add email, normalized_email, role_account and alias. Fields not listed here are never returned.

FieldTypeEndpointMeaning
emailstringemailThe checked address, lowercased, with the domain converted to ASCII (punycode for internationalized domains).
normalized_emailstringemailLowercased address with any +tag removed; for gmail.com and googlemail.com, dots in the local part are also removed. Use it to spot the same person signing up repeatedly.
domainstringbothThe checked domain, lowercased ASCII.
disposablebooleanbothtrue when the domain is a disposable / temporary-mail domain.
disposable_reasonstring or nullboth"blocklist" (domain is on Piisend’s disposable blocklist), "mx_infra" (the domain’s MX hosts match known disposable-mail infrastructure), or null.
disposable_providerstring or nullbothName of the matched disposable provider for mx_infra matches; otherwise null.
public_domainbooleanbothtrue for free public mailbox providers (Gmail, Outlook, Yahoo, …). Informational — does not affect the verdict.
relay_domainbooleanbothtrue for email forwarding / masked-alias services (SimpleLogin, addy.io, …).
spambooleanbothtrue when the domain is on the phishing list or listed on the Spamhaus DBL (DBL lookups only run when enabled on Piisend’s side). Always true when phishing is true.
phishingbooleanbothtrue when the domain is on Piisend’s phishing domain list.
mxboolean or nullbothtrue if the domain has MX records, false only on a definitive “no MX records” answer, null when MX wasn’t checked (include_mx=false) or the DNS lookup failed transiently.
mx_recordsarray of { priority, host }bothMX records found (priority integer or null, host string). [] when mx is null or false.
spfboolean or nullbothtrue if the domain publishes an SPF record, false if not, null if the lookup failed. Informational.
dmarcboolean or nullbothtrue if _dmarc.<domain> publishes a DMARC record, false if not, null if the lookup failed. Informational.
domain_age_in_daysinteger or nullbothDays since the domain was registered (from RDAP), or null if unknown.
domain_created_atstring or nullbothRegistration timestamp, ISO 8601 UTC (e.g. "1995-08-13T04:00:00Z"), or null.
did_you_meanstring or nullbothSuggested correction for a likely typo of a popular mailbox domain. The corrected email on email checks, the corrected domain on domain checks. null when there is no suggestion.
recommendationstringboth"allow", "review" or "block". See Verdict logic.
reasonsarray of stringsbothMachine-readable reasons behind the verdict. See Reasons. [] on a plain allow.
account_ruleobject or nullbothThe account rule that overrode the verdict: { "action": "block" or "allow", "type": "email", "domain" or "mx_host", "value": "..." }. null when no rule matched. See Account rules.
role_accountbooleanemailtrue for role mailboxes such as info@ or support@ (a +tag is ignored). Informational.
aliasbooleanemailtrue when the local part contains a +tag sub-address. Informational.

Lookups that fail (DNS, RDAP, blocklists) never fail the request: the affected field comes back null (or false for list lookups) and the check still counts as one credit.

Verdict logic

The verdict is computed from the signals in this order:

  1. Block reasons are collected: disposable (when disposable is true), spam (when spam is true), phishing (when phishing is true), no_mx (only when mx is exactly false).
  2. Review reasons are collected: relay (when relay_domain is true), new_domain (when domain_age_in_days is known and less than 30), possible_typo (when did_you_mean is set).
  3. If there is at least one block reason → recommendation: "block", and reasons lists the block reasons followed by any review reasons.
  4. Otherwise, if there is at least one review reason → "review" with the review reasons.
  5. Otherwise → "allow" with reasons: [].
  6. Account rules are applied last and override all of the above (see Account rules).

Signals that never change the verdict on their own: public_domain, role_account, alias, spf, dmarc, and mx: null. Use them for your own scoring if you want.

Reasons

Reasons appear in this fixed order: block reasons, then review reasons. An account rule reason is always first.

ReasonVerdictProduced when
disposableblockThe domain is on the disposable blocklist (disposable_reason: "blocklist") or its MX hosts match disposable infrastructure ("mx_infra").
spamblockThe domain is on the phishing list or listed on the Spamhaus DBL.
phishingblockThe domain is on the phishing list (so spam is always present too).
no_mxblockDNS definitively returned no MX records (mx: false). A failed or skipped lookup does not produce this.
relayreviewrelay_domain is true (forwarding / masked-alias service).
new_domainreviewThe domain was registered less than 30 days ago (domain_age_in_days < 30).
possible_typoreviewdid_you_mean has a suggestion.
account_blockblockOne of your block rules matched.
account_allowallowOne of your allow rules matched. The platform reasons stay in the list after it, so you can still see why it would have been blocked.

Example: a typo’d address on a brand-new domain returns "review" with ["new_domain", "possible_typo"]. An allowlisted disposable domain returns "allow" with ["account_allow", "disposable"].

Errors and headers

Error bodies are JSON with a detail string, e.g. {"detail": "Enter a valid email address."}.

StatusWhenCharged?
200Check completed.Yes, 1 credit
400Invalid email or domain (empty, too long — 320 characters for an email, 253 for a domain — bad syntax, or no valid TLD).No
401Missing or invalid API key.No
402Monthly check quota exhausted ("Monthly check quota exceeded"). Response includes X-Checks-Remaining: 0 and X-Checks-Limit.No
403The key lacks the scope: "Missing API key scope: check:read".No
429Rate limit exceeded ("Rate limit exceeded"). Respect the Retry-After header (seconds).No
503The Check API is disabled ("Check API is temporarily unavailable.").No

Every successful check returns:

HeaderMeaning
X-Checks-LimitYour monthly check quota.
X-Checks-RemainingCredits left this month after this check.

Quotas and rate limits

  • One credit per successful check (200) on either endpoint. Validation errors, quota errors, rate-limited and auth-failed requests are not charged. Upstream lookup failures inside a check are still charged, because the check itself completes.
  • Free plan: 1,000 checks per month. Pro includes a higher check quota — see pricing. Your exact limit is in the X-Checks-Limit header and in checks_quota from GET /billing/usage (which also returns checks_used and checks_remaining).
  • Check credits are separate from your email send quota and reset each calendar month (UTC).
  • Rate limit: GET /check/email and GET /check/domain default to 120 requests per minute per API key.

Account rules

Rules let you block or allow specific emails, domains or mail servers for your account. They are applied to every check your account makes and override the platform verdict.

typevalueMatches
emailjane@example.comThe exact address — compared against both the checked email and its normalized_email. Store the normalized form (janedoe@gmail.com) to also catch +tag and Gmail-dot variants.
domainexample.comThe domain and all its subdomains (example.com, mail.example.com).
mx_hostmx.example.netAny domain whose MX host is this host or a subdomain of it, matched on label boundaries (spoilmail.com covers mx.spoilmail.com, not notspoilmail.com). Useful for blocking a temp-mail service that rotates through many domains on the same mail server. Requires MX data, so it never matches domain checks run with include_mx=false.

Precedence:

  • Allow beats block. If an allow rule and a block rule both match, the result is allow — this is how you carve exceptions out of a broad block (block an MX host, allow one partner domain on it).
  • Within the same action, the most specific match is reported: email before domain before mx_host.
  • On a match, recommendation becomes the rule’s action, account_rule describes the rule, and account_block / account_allow is put first in reasons.
  • If rules can’t be loaded, the check fails open: the platform verdict stands and account_rule is null.
  • New and deleted rules take effect immediately on the server instance that handled the write and within 30 seconds everywhere else.

Create a rule

POST /check/rules — requires check:write. Dashboard users need the owner or admin workspace role.

bash
1# Block a repeat abuser's domain
2curl -s -X POST "https://api.piisend.com/api/v1/check/rules" \
3 -H "Authorization: Bearer $PIISEND_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{"action": "block", "type": "domain", "value": "spam-signups.example", "note": "200 fake signups in March"}'
6
7# Block a temp-mail service by its mail server
8curl -s -X POST "https://api.piisend.com/api/v1/check/rules" \
9 -H "Authorization: Bearer $PIISEND_API_KEY" \
10 -H "Content-Type: application/json" \
11 -d '{"action": "block", "type": "mx_host", "value": "mx.tempmail.example"}'
12
13# Always allow your QA inbox
14curl -s -X POST "https://api.piisend.com/api/v1/check/rules" \
15 -H "Authorization: Bearer $PIISEND_API_KEY" \
16 -H "Content-Type: application/json" \
17 -d '{"action": "allow", "type": "email", "value": "qa@yourcompany.com"}'
Body fieldRequiredNotes
actionyes"block" or "allow".
typeyes"email", "domain" or "mx_host".
valueyesLowercased and converted to ASCII. A leading @ or *. on domain / MX values is stripped. Must be a valid email or hostname with at least one dot.
notenoFree text, up to 500 characters.

Returns 201 with the rule: { "id", "action", "type", "value", "note", "created_at", "created_by" }. Errors: 400 for an invalid action, type, value or note, or when the account already has 5,000 rules; 409 when a rule with the same type and value already exists (regardless of action — delete it first to flip block to allow).

List and delete rules

bash
1# List (filters optional)
2curl -s "https://api.piisend.com/api/v1/check/rules?action=block&type=domain&limit=50" \
3 -H "Authorization: Bearer $PIISEND_API_KEY"
4
5# Delete
6curl -s -X DELETE "https://api.piisend.com/api/v1/check/rules/RULE_ID" \
7 -H "Authorization: Bearer $PIISEND_API_KEY"
  • GET /check/rules (scope check:read) — query params action, type, limit (1–50, default 25), offset, page (1-based; used when offset is 0). Returns { "items": [...], "total", "limit", "offset", "has_more" }, newest first.
  • DELETE /check/rules/{id} (scope check:write) — returns {"message": "Rule deleted"}, or 404 if the rule doesn’t exist in your account.

Logs and stats

Every successful check is logged for your account and kept for 30 days. Logging runs after the response is sent and never fails a check.

GET /check/logs

Scope check:read. Newest first.

Query parameterMeaning
recommendationallow, review or block.
kindemail or domain.
qPrefix match on the checked email or domain (case-insensitive).
sinceOnly checks at or after this ISO 8601 timestamp.
limit, offset, pagePagination, same as rules (max 50 per page).
bash
1# Blocked checks for addresses starting with "jane"
2curl -s "https://api.piisend.com/api/v1/check/logs?recommendation=block&q=jane&limit=50" \
3 -H "Authorization: Bearer $PIISEND_API_KEY"

Each item: id, kind, query (the checked value, lowercased), domain, recommendation, reasons, disposable, relay_domain, spam, account_rule, api_key_id (the key that made the check; null for dashboard checks), client_ip_hash, created_at. client_ip_hash is a salted SHA-256 hash of the IP address that called the API — the raw IP is never stored. When you call from your server, that is your server’s IP, not the end user’s.

GET /check/stats

Scope check:read. Query param days (1–365, default 30; logs older than 30 days have already expired). Example response (values illustrative):

json
1{
2 "days": 30,
3 "since": "2026-10-30T12:00:00",
4 "total": 1840,
5 "by_recommendation": { "allow": 1702, "review": 61, "block": 77 },
6 "by_reason": { "disposable": 58, "possible_typo": 40, "relay": 21, "no_mx": 12 },
7 "top_blocked_domains": [{ "domain": "mailinator.com", "count": 19 }]
8}

top_blocked_domains returns up to 10 domains. Use it with POST /check/rules to turn a recurring offender into a permanent block (for example by its mx_host).

Handle each verdict differently instead of treating everything that isn’t allow as an error:

VerdictWhat to do
blockReject the signup with a neutral message: “Please use a permanent email address.” Don’t echo the internal reason.
review with possible_typoAsk the user to confirm: “Did you mean did_you_mean?” Let them accept the suggestion or keep what they typed.
review (other reasons)Either ask for another email, or allow and flag the account (e.g. require email verification before trial credits, add to a manual-review queue). relay users are usually real people protecting their inbox.
allowContinue. Store normalized_email if you want to detect duplicate accounts.

Fail open. The check does live DNS and registry lookups, so give it a timeout and allow the signup if Piisend times out, returns 5xx, 429 or 402. Only 400 should be shown to the user (as an invalid-email error).

javascript
1// Next.js Route Handler / Express / any Node 18+ server code
2export async function checkSignupEmail(email) {
3 try {
4 const res = await fetch(
5 `https://api.piisend.com/api/v1/check/email/${encodeURIComponent(email)}`,
6 {
7 headers: { Authorization: `Bearer ${process.env.PIISEND_API_KEY}` },
8 signal: AbortSignal.timeout(3000), // your choice of timeout
9 },
10 );
11 if (res.status === 400) return { ok: false, message: "Enter a valid email address." };
12 if (!res.ok) return { ok: true, flagged: true }; // fail open on 402/429/5xx
13
14 const check = await res.json();
15 if (check.recommendation === "block") {
16 return { ok: false, message: "Please use a permanent email address." };
17 }
18 if (check.reasons.includes("possible_typo")) {
19 return { ok: false, suggestion: check.did_you_mean };
20 }
21 return { ok: true, flagged: check.recommendation === "review", check };
22 } catch {
23 return { ok: true, flagged: true }; // timeout or network error: fail open
24 }
25}
python
1import os
2from urllib.parse import quote
3
4import requests
5
6
7def check_signup_email(email: str) -> dict:
8 try:
9 r = requests.get(
10 f"https://api.piisend.com/api/v1/check/email/{quote(email, safe='@')}",
11 headers={"Authorization": f"Bearer {os.environ['PIISEND_API_KEY']}"},
12 timeout=3, # your choice of timeout
13 )
14 except requests.RequestException:
15 return {"ok": True, "flagged": True} # fail open
16 if r.status_code == 400:
17 return {"ok": False, "message": "Enter a valid email address."}
18 if not r.ok:
19 return {"ok": True, "flagged": True} # 402/429/5xx: fail open
20 check = r.json()
21 if check["recommendation"] == "block":
22 return {"ok": False, "message": "Please use a permanent email address."}
23 if "possible_typo" in check["reasons"]:
24 return {"ok": False, "suggestion": check["did_you_mean"]}
25 return {"ok": True, "flagged": check["recommendation"] == "review", "check": check}

Piisend also rejects disposable recipients on POST /emails by default (see Sending), so a disposable address that slips through signup still can’t receive your verification email.

Migrating from POST /intelligence/*

The older Intelligence routes still work, but they now follow the same access and billing rules as the Check API:

  • POST /intelligence/email, /disposable-email, /email-provider, /role-email, /mx-records, /dns-auth, /spam-domain — JSON body ({"email": ...} or {"domain": ...}). They require the check:read scope (403 without it) and use one check credit per successful call (invalid input returns 400 and is not charged; 402 when the month's credits are used up; X-Checks-* headers are set). No account rules, no logs, rate limit 60 requests per minute per key by default. They return { "input", "signals": {...}, "summary" } with no verdict — switch to GET /check/email to get the verdict, account rules and logging for the same credit.
  • POST /intelligence/full with {"email": "..."} is the POST equivalent of GET /check/email/{email}: same response, same check:read scope, same metering, account rules and logging. It uses the Intelligence rate limit (60/minute by default) and returns 503 if either the Intelligence API or the Check API is disabled. Use it if you’d rather not put email addresses in URL paths (and your access logs).

Field mapping from POST /intelligence/email to GET /check/email:

Old (signals.*)New
disposabledisposable (plus disposable_reason, disposable_provider)
public_domainpublic_domain
role_accountrole_account
subaddressalias
domaindomain
summary (text)recommendation + reasons (machine-readable)

If your code did if (signals.disposable) reject(), switch to if (check.recommendation === "block") reject() — that also covers spam, phishing and no-MX domains, plus your own block rules. Make sure the key has check:read, and budget for one check credit per call.

Documentation

Integrate with the REST API

Quickstart, API reference, and IDE prompts—everything you need to send from your app.