Integrations · CRM

Validate your Copper people

Check the email addresses of your Copper people and write each result into four person custom fields, so a filtered view can leave out the addresses you should not mail. A script you run on your own computer reads every person, checks the addresses (up to 50 one by one, more as one bulk list) and writes the results back. It never deletes, merges or changes a person's address. Download it: email-validation-copper.zip holds copper.mjs (the script) and the MIT licence.

What you need

  • A computer with Node 22.18 or later. Nothing to install: the script has no dependencies.
  • An API key of ours from the API keys page with Validate addresses, and the permission Bulk lists (off by default: turn it on when you create the key) for more than 50 people.
  • A Copper plan with API access (Copper names its trial, Professional and Business plans) and a Copper API key: in Copper's web app, System settings → API Keys → Generate API key. The key acts as the user who made it, so make it as an admin who sees every person: the first run creates the four custom fields. Copper also asks for that user's sign-in address with every call; the script sends it in a header, never in a link.

Try it free first

Every definite result uses one credit (unknown results, malformed and test addresses are free), so try it on a Copper account that holds only test people, never on your real ones. Give one test person the address no_mailbox@sandbox.email-validation.org (sandbox checks are free; that domain receives no mail, so send it nothing), then:

cd email-validation-copper                    # the unzipped folder
export COPPER_API_KEY=… COPPER_USER_EMAIL=… EV_API_KEY=…
node copper.mjs --dry-run                     # creates nothing, checks nothing, writes nothing: only counts
node copper.mjs                               # creates the four fields if missing, checks and writes

In Windows PowerShell (5.1 or 7):

cd email-validation-copper                    # the unzipped folder
$env:COPPER_API_KEY = "…"; $env:COPPER_USER_EMAIL = "…"; $env:EV_API_KEY = "…"
node copper.mjs --dry-run                     # creates nothing, checks nothing, writes nothing: only counts
node copper.mjs                               # creates the four fields if missing, checks and writes

COPPER_USER_EMAIL is the Copper sign-in address of the user who made the Copper key. The person's ev_status field says invalid and ev_reason says no_mailbox. Run it once more: it reports nothing to check, because every result was written. Then delete the test person.

Run it

node copper.mjs --dry-run     # how many people would be checked; free
node copper.mjs               # checks and writes

Up to 50 addresses are checked one by one; more go out as one bulk list. A person is checked by their first address, and one whose address already has a result is skipped (an unknown result is checked again), so a daily run checks only new and changed addresses. If a run stops, run the same command again from the same folder: it resumes the same bulk list and never pays twice (within the 30 days a list is kept). The state file (.ev-copper-<account id>.json) lives in that folder. It prints ids and counts, never an address or a key.

Copper's search returns at most 100,000 people, so an account with more stops with a message before anything is checked.

Options:

  • --region eu: checked in the EU, lists and results kept there, with the same key.
  • --revalidate: check again addresses that already have a result.
  • --rate N: Copper requests a second (default 2, at most 3). Copper allows 180 requests a minute; when it refuses, the script waits what Copper asks (a few seconds when it does not say), up to a minute per wait, and tries again; if Copper still refuses after four tries, it stops and the same command resumes.
  • --state FILE: a state file of your own choosing.

Exit codes: 0 done; 1 a write failed or the run stopped (run it again: nothing is paid twice); 2 wrong options; 75 the bulk list was still being checked when the script stopped waiting (run it again later to collect it).

What it writes

Four person custom fields of the data type Copper's API calls String (a text field), available on people, created by the first run when they are missing (an admin can create them in Copper first, with exactly these names):

FieldHolds
ev_statusvalid, invalid, catch_all, unknown or disposable
ev_reasonthe reason, for example no_mailbox or accepted
ev_checked_atwhen it was checked
ev_address_hasha hash of the address the result belongs to, so a changed address is checked again

Spam traps and complainers are valid with a warning reason: see what each status means. Each result is written by person id, and only while the person still holds the address that was checked; the write sends only these four custom fields, and Copper changes only what a write holds, so the person's other fields and addresses stay as they are. A result that could not be written is kept in a file next to the state file and written by the next run without a new check.

A people filter on ev_status is invalid or disposable finds the people to leave out of your mailings.

End the access

Delete the Copper API key in Copper (System settings → API Keys) and our key on the API keys page. The four fields stay on your people until you delete them in Copper.

More on Copper

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us