# Block disposable email signups

A disposable email service hands out inboxes that need no signup and are meant to be thrown away. People use them to grab a free trial again and again, to collect a coupon twice, or to avoid hearing from you. This guide detects them at signup and helps you decide what to do about them.

## How the API detects them

`POST /email` compares the domain of the address with the community-maintained disposable-email-domains list, credited on the [data sources page](/data-sources). A match sets `checks.disposable` to `true`, and the address comes back with `status: "risky"` and `reason: "disposable"`.

The list check does not need the mailbox check, so `fast` mode is enough: it answers without waiting for a mail server and costs the same 1 credit as a full check.

```bash
curl https://api.qelka.com/v1/email \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "jane.doe@mailinator.com", "mode": "fast"}'
```

```json
{
  "id": "lkp_01M84BQATRBBF6AZ3K2CGMHC10",
  "object": "email",
  "input": "jane.doe@mailinator.com",
  "status": "risky",
  "reason": "disposable",
  "did_you_mean": null,
  "checks": {
    "syntax": true,
    "mx": true,
    "smtp": null,
    "catch_all": null,
    "disposable": true,
    "role": false,
    "free_provider": false
  },
  "domain": { "name": "mailinator.com", "spf": true, "dmarc": true },
  "score": 50,
  "credits_used": 1,
  "cached": false
}
```

Read `checks.disposable` rather than `status` or `reason`: it answers exactly the question you are asking, and it is always present as `true` or `false`.

## Decide: block, flag or allow

Blocking disposable addresses is not always right. It depends on what an extra account costs you.

| Your product | Suggested policy | Why |
|---|---|---|
| Free trial, free credits, coupons, referral rewards | Block | Each throwaway signup takes something of value. |
| Community, marketplace, anything with messaging between users | Block, or allow with limits until the email is confirmed | Throwaway accounts are a common tool for spam and abuse. |
| Newsletter or content download | Allow, or flag | The person chose not to give you a real inbox; mail to it is wasted but harmless. |
| Paid product, card required | Allow and flag | The card already proves intent. You may still want a working address for receipts. |

Disposable services are not the same as email aliases and relays, which forward to a real inbox that the person keeps reading. If a domain you consider legitimate gets flagged for your users, keep an allowlist on your side and check it before the API result.

## The code

A function that returns `true` when an address should be refused, failing open when the API is not reachable:

```javascript
const allowlist = new Set(['partner.example'])

export async function isDisposable(email) {
  const response = await fetch('https://api.qelka.com/v1/email', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ email, mode: 'fast' }),
    signal: AbortSignal.timeout(5000),
  }).catch(() => null)
  if (!response?.ok) return false
  const result = await response.json()
  return result.checks.disposable && !allowlist.has(result.domain.name)
}
```

In an Express signup route:

```javascript
app.post('/signup', express.json(), async (req, res) => {
  if (await isDisposable(req.body.email)) {
    return res.status(422).json({
      field: 'email',
      message: 'Please use a permanent email address. We will send your receipts and password resets there.',
    })
  }
  res.status(201).json(await createUser(req.body))
})
```

`createUser` stands for your own account creation code.

The same check in Python:

```python
import os

import requests

ALLOWLIST = {"partner.example"}


def is_disposable(email):
    try:
        response = requests.post(
            "https://api.qelka.com/v1/email",
            headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
            json={"email": email, "mode": "fast"},
            timeout=5,
        )
    except requests.RequestException:
        return False
    if not response.ok:
        return False
    result = response.json()
    return result["checks"]["disposable"] and result["domain"]["name"] not in ALLOWLIST
```

If you already verify the address in `full` mode at signup, read `checks.disposable` from that result instead of making a second call. [Validate signup forms](/docs/guides/validate-signup-forms) does exactly that.

## Word the message well

The person in front of the form may simply not know their address is temporary, or may be testing your product before trusting you with their real inbox. Tell them what you need and why, without accusing them:

- Good: "Please use a permanent email address. We will send your receipts and password resets there."
- Not good: "Disposable emails are not allowed."

Do not reveal how detection works or which domains you block: the message only needs to say what to do next.

## Combine with other signals

Disposable addresses are one signal of a throwaway account, not the only one:

- `did_you_mean` and `undeliverable` catch typos and invented addresses.
- The [IP lookup](/docs/guides/flag-vpn-and-datacenter-traffic) flags signups from data centers, Tor and known VPNs.
- Limit signups per IP address and per device on your side.
- Delay the valuable part, such as trial credits or a coupon, until the email address is confirmed.

## Test it

With a test key, `disposable@example.com`, or any address whose part before the `@` is `disposable`, comes back with `checks.disposable` set to `true`, and any other well-formed address with `false`. To see a real result, use a live key with a known disposable domain such as `mailinator.com`, or try a few addresses in the free [disposable email checker](/tools/disposable-email-checker).
