Docs

Verify

View as MarkdownOpen in ChatGPTOpen in Claude

Check one address, or up to 100 in one call. Each address costs one credit; unknown results are refunded automatically. Results come from the 30-day result cache when possible (still one credit).

One address

POST /v1/verify with {"email": "...", "wait": 25}. wait (0–25 seconds, default 25) is how long to hold the connection for the SMTP probe. If the probe has not finished by then you get 202 with state: "pending"; poll GET /v1/verify/{id} until state is done.

Send an Idempotency-Key header (1–200 characters) to make retries free: the same key returns the same request instead of charging again.

curl https://api.mails.fit/v1/verify \
  -H "Authorization: Bearer $MAILSFIT_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-42" \
  -d '{"email": "jane@example.com", "wait": 10}'
async function verify(email) {
  const headers = { Authorization: `Bearer ${process.env.MAILSFIT_KEY}` };
  let res = await fetch("https://api.mails.fit/v1/verify", {
    method: "POST",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({ email, wait: 10 }),
  });
  let v = await res.json();
  while (v.state === "pending") {
    await new Promise((r) => setTimeout(r, 2000));
    v = await (await fetch(`https://api.mails.fit/v1/verify/${v.id}`, { headers })).json();
  }
  return v;
}
import os, time, requests

API = "https://api.mails.fit/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MAILSFIT_KEY']}"}

def verify(email):
    v = requests.post(f"{API}/verify", headers=HEADERS, json={"email": email, "wait": 10}, timeout=30).json()
    while v.get("state") == "pending":
        time.sleep(2)
        v = requests.get(f"{API}/verify/{v['id']}", headers=HEADERS, timeout=30).json()
    return v
func verify(email string) (map[string]any, error) {
	payload, _ := json.Marshal(map[string]any{"email": email, "wait": 10})
	req, _ := http.NewRequest("POST", "https://api.mails.fit/v1/verify", bytes.NewReader(payload))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("MAILSFIT_KEY"))
	req.Header.Set("Content-Type", "application/json")
	res, err := (&http.Client{Timeout: 30 * time.Second}).Do(req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	var v map[string]any
	err = json.NewDecoder(res.Body).Decode(&v)
	return v, err // poll GET /v1/verify/{id} while v["state"] == "pending"
}
function verify(string $email): array {
    $ch = curl_init("https://api.mails.fit/v1/verify");
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTPHEADER => [
            "Authorization: Bearer " . getenv("MAILSFIT_KEY"),
            "Content-Type: application/json",
        ],
        CURLOPT_POSTFIELDS => json_encode(["email" => $email, "wait" => 10]),
    ]);
    return json_decode(curl_exec($ch), true); // poll GET /v1/verify/{id} while state is pending
}
async fn verify(client: &reqwest::Client, key: &str, email: &str) -> reqwest::Result<serde_json::Value> {
    let mut v: serde_json::Value = client
        .post("https://api.mails.fit/v1/verify")
        .bearer_auth(key)
        .json(&serde_json::json!({ "email": email, "wait": 10 }))
        .send().await?.json().await?;
    while v["state"] == "pending" {
        tokio::time::sleep(std::time::Duration::from_secs(2)).await;
        let url = format!("https://api.mails.fit/v1/verify/{}", v["id"]);
        v = client.get(url).bearer_auth(key).send().await?.json().await?;
    }
    Ok(v)
}

Batch

POST /v1/verify/batch with {"emails": [...], "wait": 25} verifies 1 to 100 addresses through the same pipeline, one credit each, and waits for them together. It always answers 200 with one item per address, in order:

  • a verification (same fields as above; state may be pending, poll its id), or
  • {"email": "...", "error": {"code": "...", "message": "..."}} when that address was not charged (for example an empty string).

The whole batch is refused with 402 insufficient_credits when your balance cannot cover it. With Idempotency-Key: K, item i uses the key K:i, so a retry charges only addresses not sent before (K at most 190 characters). For more than 100 addresses, upload a list.

curl https://api.mails.fit/v1/verify/batch \
  -H "Authorization: Bearer $MAILSFIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"emails": ["jane@example.com", "info@example.org"], "wait": 20}'
const res = await fetch("https://api.mails.fit/v1/verify/batch", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MAILSFIT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ emails: ["jane@example.com", "info@example.org"], wait: 20 }),
});
const { results, pending } = await res.json();
for (const r of results) console.log(r.email, r.status ?? r.error?.code);
res = requests.post(
    "https://api.mails.fit/v1/verify/batch",
    headers={"Authorization": f"Bearer {os.environ['MAILSFIT_KEY']}"},
    json={"emails": ["jane@example.com", "info@example.org"], "wait": 20},
    timeout=60,
)
for r in res.json()["results"]:
    print(r["email"], r.get("status") or r["error"]["code"])
payload, _ := json.Marshal(map[string]any{
	"emails": []string{"jane@example.com", "info@example.org"},
	"wait":   20,
})
req, _ := http.NewRequest("POST", "https://api.mails.fit/v1/verify/batch", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("MAILSFIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := (&http.Client{Timeout: 60 * time.Second}).Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
var out struct {
	Results []map[string]any `json:"results"`
	Pending int              `json:"pending"`
}
json.NewDecoder(res.Body).Decode(&out)
$ch = curl_init("https://api.mails.fit/v1/verify/batch");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 60,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("MAILSFIT_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode(["emails" => ["jane@example.com", "info@example.org"], "wait" => 20]),
]);
foreach (json_decode(curl_exec($ch), true)["results"] as $r) {
    echo $r["email"], " ", $r["status"] ?? $r["error"]["code"], "\n";
}
let out: serde_json::Value = reqwest::Client::new()
    .post("https://api.mails.fit/v1/verify/batch")
    .bearer_auth(std::env::var("MAILSFIT_KEY")?)
    .json(&serde_json::json!({ "emails": ["jane@example.com", "info@example.org"], "wait": 20 }))
    .send()
    .await?
    .json()
    .await?;
for r in out["results"].as_array().into_iter().flatten() {
    println!("{} {}", r["email"], r.get("status").unwrap_or(&r["error"]["code"]));
}
{
  "results": [
    { "id": 1843, "state": "done", "email": "jane@example.com", "status": "deliverable", "reason": "accepted", "score": 95, "...": "..." },
    { "id": 1844, "state": "pending" }
  ],
  "pending": 1
}

Response fields

FieldTypeMeaning
idintegerRequest id; poll GET /v1/verify/{id}
statedone or pendingpending comes with HTTP 202
emailstringThe address as checked
statusstringdeliverable, risky, undeliverable or unknown
reasonstringWhy; see the table below
score0–10080–100 send, 50–79 care, 0–49 drop
suggestion / did_you_meanstring or nullTypo fix, for example jane@gmail.com for jane@gmial.com (same value)
disposablebooleanThrowaway inbox provider
freebooleanFree mailbox provider (gmail.com, outlook.com, ...)
rolebooleanRole address (info@, sales@, ...)
catch_allboolean or nullThe domain accepts any address; null when not tested
mx_foundboolean or nullThe domain publishes MX hosts; null when DNS was not read
mx_group / smtp_providerstringgoogle, microsoft, yahoo, mimecast or other (same value)
mx_hoststring or nullThe MX host that answered
smtp_codeinteger or nullSMTP reply code to RCPT TO
spam_trap_riskarraytypo_domain, listed_domain, trap_local_part; omitted when empty. A risk signal, never a verdict

Reasons

Each reason maps to exactly one status.

ReasonStatusMeaning
accepteddeliverableThe mailbox server accepted the recipient
invalid_syntaxundeliverableNot a valid address
no_mxundeliverableThe domain has no mail server
user_unknownundeliverableThe server says the mailbox does not exist
mx_not_publicundeliverableEvery MX address is private or unreachable from the internet
catch_allriskyThe domain accepts any address, so this one cannot be confirmed
roleriskyAccepted, but a shared role mailbox
disposableriskyThrowaway inbox provider
mailbox_fullriskyThe mailbox exists but is full
provider_unverifiableriskyMicrosoft 365 or Yahoo accepted without a clear answer for a random control address
greylistedunknownTemporary deferral; try later
blockedunknownThe server refused our probe, not the mailbox
timeoutunknownNo answer in time
dns_errorunknownDNS lookup failed temporarily
inconclusiveunknownA refusal that proves nothing about the mailbox
suppressedunknownThe domain or address opted out; nothing was checked