Direct mail API for developers and growth teams. Read the docs →

CASS-certified address verification before an API mailing

CASS certified address verification uses software USPS has certified under its CASS program. CASS-certified software standardizes an address, codes its ZIP+4, delivery point and carrier route, and runs DPV, which says whether USPS delivers to that exact address. Check every list before you mail it: USPS throws away undeliverable Marketing Mail that carries no endorsement, after you’ve paid to print and post it. With Mailr, add "verify": true to a send, or call POST /v1/addresses/verify first to sort the list yourself.

On this page
  1. What CASS-certified address verification checks for an API mailing
  2. DPV codes an address API returns
  3. What happens to a bad address in an API mailing
  4. How to verify addresses with an API before you mail
  5. What CASS can’t tell you about an API mailing list
  6. Address verification questions from API senders

What CASS-certified address verification checks for an API mailing

USPS certifies the software, not the address list. To be certified, a product has to code a USPS test file of about 150,000 addresses with at least 98.5% accuracy on ZIP+4, carrier route and five-digit ZIP, and 100% on delivery point coding. The current certification period is Cycle O, valid through July 31, 2028.

A CASS check does more than say yes or no. It returns the address in USPS’s standard form and adds the codes USPS sorts by. Certified products also include these USPS data sets: USPS’s own address API, which needs a paid license since August 2026, is covered in USPS address verification API.

  • DPV (Delivery Point Validation): whether the address is in USPS’s delivery file as a known address.
  • LACSLink: the new address for rural-style addresses converted to city-style, mostly for 911 service.
  • SuiteLink: the suite number for a business address that was missing one.

DPV codes an address API returns

2 Elm St Apt 4, Phoenix AZPOST /v1/addresses/verifyYConfirmed, apartment includedSBuilding confirmed, apartment not recognizedDBuilding confirmed, apartment missingNStreet number not found
Four answers from one check. DPV says whether USPS delivers to the exact address. A send with "verify": true stops only on N; read the code yourself to hold S and D.
DPV codeWhat USPS meansMailr’s deliverabilityWhat to do
YConfirmed, including any apartment or suitedeliverableMail it
SBuilding confirmed; the apartment or suite sent wasn’t validdeliverable_incorrect_unitCheck the unit first
DBuilding confirmed; it needs an apartment or suite that’s missingdeliverable_missing_unitGet the unit first
NThe street number isn’t a known delivery pointundeliverableDon’t mail

Two flags come with the code. Vacant means the address was active but is now empty, in most cases unoccupied for over 90 days; hold it. CMRA means a commercial mail receiving agency, a private business that receives mail for its clients, like a mailbox store. Mail there arrives, but it isn’t a home. Private mailbox addresses get their own footnotes, covered in CMRA addresses.

What happens to a bad address in an API mailing

For USPS Marketing Mail with no endorsement, a piece USPS can’t deliver is disposed of. You paid for the print and the postage, and nothing comes back to tell you. That’s why the check belongs before the send, not after.

With "verify": true on a postcard, flat or batch, Mailr checks every address before anything is created. If any address comes back undeliverable, the whole request is rejected with a 422 naming the bad recipients, and nothing is created or charged. If they all pass, each piece is mailed to the standardized address.

How to verify addresses with an API before you mail

  • "verify": true on a send is one step. It stops on undeliverable addresses only; vacant addresses and missing apartment numbers still mail.
  • POST /v1/addresses/verify checks up to 1,000 addresses and returns each one’s deliverability, the standardized address with ZIP+4, whether it’s residential, the vacant flag and the DPV footnotes. Use it when you want to hold vacant addresses or ask customers for a missing unit.

Both cost 7¢ an address on pay as you go. With a test key the check is a free simulation: any address with “undeliverable” in its first or second line fails, so you can test both paths. Each result also carries the ZIP+4, explained in ZIP+4 lookup.

customers.csvPOST /v1/addresses/verifyMail: deliverableFix: apartment missing or wrongHold: vacant or undeliverableBatch
Check first, then send. One verify call per 1,000 addresses sorts the list; the batch mails only the confirmed, standardized addresses, so nothing is paid for twice.
# Check a list before you mail it. customers.csv: id, name, first_name, line1, line2, city, state, zip
import csv, os, requests

API = "https://api.mailr.dev/v1"
H = {"Authorization": f"Bearer {os.environ['MAILR_API_KEY']}"}

with open("customers.csv", newline="") as f:
    rows = list(csv.DictReader(f))

send, fix, hold = [], [], []
for start in range(0, len(rows), 1000):  # one verify call takes up to 1,000 addresses
    chunk = rows[start:start + 1000]
    res = requests.post(f"{API}/addresses/verify", headers=H, timeout=60, json={"addresses": [
        {"name": r["name"][:40], "line1": r["line1"], "line2": r["line2"] or None,
         "city": r["city"], "state": r["state"], "zip": r["zip"]} for r in chunk]})
    res.raise_for_status()
    for r, v in zip(chunk, res.json()["data"]):
        if v["deliverability"] == "undeliverable" or v["vacant"]:
            hold.append(r)
        elif v["deliverability"] in ("deliverable_missing_unit", "deliverable_incorrect_unit"):
            fix.append(r)  # ask the customer for the apartment or suite
        else:
            send.append({"to": {**v["address"], "name": r["name"][:40]}, "merge": {"first_name": r["first_name"][:14]}})

print(len(send), "to mail,", len(fix), "to fix,", len(hold), "held")
# send holds standardized addresses (ZIP+4 included), so the batch doesn't need "verify" again.
for n, start in enumerate(range(0, len(send), 1000)):
    b = requests.post(f"{API}/batches", headers={**H, "Idempotency-Key": f"checked-list-{n}"}, timeout=60, json={
        "kind": "postcard", "size": "6x9", "template": "tmpl_thank_you",
        "merge": {"promo_code": "TRAIL15"}, "recipients": send[start:start + 1000]})
    b.raise_for_status()
    print(b.json()["id"], b.json()["count"], b.json()["price"])
The script sends the standardized addresses the check returned, so the batch itself doesn’t pay for a second check.

What CASS can’t tell you about an API mailing list

  • Who lives there. USPS says DPV doesn’t confirm the owners, occupants or residents at an address. A valid address can still be the wrong person: that’s what NCOA is for.
  • The fix. DPV doesn’t add missing data or correct anything. It tells you the apartment is missing; you still have to get it.
  • How good your file is overall. CASS processing doesn’t measure the accuracy of the codes in your list, only matches each address it’s given.

Address verification questions from API senders

Is CASS required to mail?

Not for every piece, but USPS requires CASS-certified address matching for mail sent at automation prices, in both First-Class Mail and USPS Marketing Mail. Even where it isn't required, it's the cheapest way to stop paying for mail that can't arrive.

What does Mailr's address check use?

Smarty's US Street API, which matches each address against USPS data. USPS publishes the vendors that hold CASS certification in its CASS Certified Products Guide on PostalPro.

What does a check cost?

7¢ an address on pay as you go and 6¢ on Agency, whether you add "verify": true to a send or call POST /v1/addresses/verify. Test keys get a free simulation.

Does CASS tell me if the person still lives there?

No. USPS says DPV doesn't confirm who lives at an address. For people who moved, run the list through NCOA.

What happens to a piece sent to a bad address?

USPS Marketing Mail that can't be delivered and carries no endorsement is disposed of by USPS. You don't get it back, and you don't hear about it.

START SENDING

Put your first postcard in the mail

Create a key, send a test to yourself, and check the proof before anything prints.

Start sending
  • Postcards, flats and folded mailers
  • A proof before anything prints
  • Free test mode: nothing prints, nothing charges
  • A status for every piece

Free price sheet

Get the price sheet by email

Every postcard, letter, mailer and print product on every plan, with postage included.

We’ll email you the price sheet. By continuing you agree to the Terms and Privacy Policy.

Download the template kit?

mailr-kit.zip · about 310 KB · 59 text files

Only HTML, JSON and Markdown files. No programs, scripts or macros, nothing that installs or runs.