Integrations · CRM
Validate your Less Annoying CRM contacts
Check the email addresses of your Less Annoying CRM contacts and write each result into four custom fields, so a filtered list can leave out the addresses you should not mail. A script you run on your own computer reads every contact, 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 contact's address. Download it: email-validation-less-annoying-crm.zip holds less-annoying-crm.mjs (the script) and the MIT license.
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 contacts.
- A Less Annoying CRM API key: in Less Annoying CRM, Settings → Programmer API. Give it the rights to read and edit, and to create for the first run, which creates the four custom fields: only an account administrator can create custom contact fields, so make the key as an administrator. The key acts as its user and reaches only the contacts that user may edit.
Try it free first
Every definite result uses one credit (unknown results, malformed and test addresses are free), so try it on a Less Annoying CRM account that holds only test contacts (Less Annoying CRM offers a 30-day trial), never on your real ones. Give one test contact 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-less-annoying-crm # the unzipped folder
export LACRM_API_KEY=… EV_API_KEY=…
node less-annoying-crm.mjs --dry-run # creates nothing, checks nothing, writes nothing: only counts
node less-annoying-crm.mjs # creates the four fields if missing, checks and writesIn Windows PowerShell (5.1 or 7):
cd email-validation-less-annoying-crm # the unzipped folder
$env:LACRM_API_KEY = "…"; $env:EV_API_KEY = "…"
node less-annoying-crm.mjs --dry-run # creates nothing, checks nothing, writes nothing: only counts
node less-annoying-crm.mjs # creates the four fields if missing, checks and writesThe contact'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 contact.
Run it
node less-annoying-crm.mjs --dry-run # how many contacts would be checked; free
node less-annoying-crm.mjs # checks and writesUp to 50 addresses are checked one by one; more go out as one bulk list. A contact is checked by its first email address (Less Annoying CRM marks none as primary); companies are not checked. 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-less-annoying-crm-<user id>.json, named by the key's user) lives in that folder, so always run it with keys of the same user: another user's key starts its own state and checks again the contacts both users see. It prints ids and counts, never an address or a key.
Less Annoying CRM publishes no rate limit, so the script sends 2 requests a second by default. A run sends one request for every 500 contacts it reads and two for every contact it writes.
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: Less Annoying CRM requests a second, 1 to 4.--state FILE: a state file of your own choosing.LACRM_TIMEOUT_MS: how long one Less Annoying CRM request may take, in milliseconds (1 to 60000; default 30000).
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 custom contact fields of type Text, created by the first run when they are missing (an administrator can create them in Less Annoying CRM first, with exactly these names):
| Field | Holds |
|---|---|
ev_status | valid, invalid, catch_all, unknown or disposable |
ev_reason | the reason, for example no_mailbox or accepted |
ev_checked_at | when it was checked |
ev_address_hash | a hash of the address the result belongs to, so a changed address is checked again |
A field of one of these names that is not a Text field, belongs to a pipeline, or is there twice stops the run before anything is checked. Spam traps and complainers are valid with a warning reason: see what each status means. Each result is written by contact id, and only while the contact, read again just before, still holds the address that was checked; the write holds only these four values, and Less Annoying CRM changes only the fields a write holds, so the contact's names, addresses, company and other fields stay as they are. The first write of a run is read back once: if the contact does not hold the four values as written, the run stops before any other write. 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 contact filter on ev_status is invalid or disposable finds the contacts to leave out of your mailings.
End the access
Delete the key in Less Annoying CRM (Settings → Programmer API) and our key on the API keys page. The four fields stay on your contacts until you delete them in Less Annoying CRM.