Integrations · CRM

Validate your HighLevel contacts

Check the email addresses of the contacts in a HighLevel sub-account and keep each verdict in five contact custom fields, so smart lists and workflows can leave out the contacts you should not mail. Two pieces, use either or both:

  • For the contacts you already have: a script checks every contact without a verdict as one bulk list and writes the fields back.
  • For every new or changed contact: a workflow with a Custom Webhook action calls a small relay you deploy, which checks the address and writes the fields within seconds.

It writes only these fields (and, if you choose, a tag and the email do-not-disturb). It never deletes a contact, a tag or anything else, and never changes an address, a name or any other field. A check that is slow or fails changes nothing. (HighLevel's API calls a sub-account a location, hence HIGHLEVEL_LOCATION_ID below.)

Download it: email-validation-highlevel.zip holds highlevel.mjs (the script), relay.mjs (the relay), webhook.json (the Custom Webhook's settings) and the MIT licence.

What you need

  • An API key of ours from the API keys page with Validate addresses (on by default), and for the script also Bulk lists (off by default: turn it on when you create the key).
  • A Private Integration token of the sub-account. In HighLevel: Settings > Private Integrations > Create New Integration, with the scopes contacts.readonly, contacts.write, locations/customFields.readonly and locations/customFields.write. HighLevel shows the token only once: copy it then. It can do everything its scopes allow, deleting contacts included (this code never does): keep it secret.
  • The sub-account's id: the id in the sub-account's address in your browser (…/v2/location/<id>/…).
  • For the script, a computer with Node 22.18 or later (nothing to install). For the relay, a Cloudflare account.

Agencies set it up once per sub-account.

The fields

Contact custom fieldValue
ev_statusvalid, invalid, catch_all, unknown or disposable (statuses)
ev_reasonwhy, such as accepted, no_mailbox or spamtrap
ev_actionsend, send_with_caution, remove or retry_later
ev_checked_atwhen the check ran, in UTC
ev_address_hashwhich address the verdict is for (a hash of it, never the address)

Build your smart lists and workflows on ev_action remove: that includes spam traps and complainers, which are valid with the action remove. A contact whose address changes is checked again at its new address.

Create the five fields first (this checks nothing and needs no key of ours):

cd email-validation-highlevel              # the unzipped folder
export HIGHLEVEL_TOKEN=…  HIGHLEVEL_LOCATION_ID=…
node highlevel.mjs --setup

Or create them by hand: Settings > Custom Fields > the Contact object > Fields > Create field, type Single line, with exactly those names.

Check new contacts: the relay

Deploy the relay to your Cloudflare account from the unzipped folder:

npx wrangler deploy relay.mjs --name ev-highlevel-relay --compatibility-date 2026-10-01 \
  --var HIGHLEVEL_LOCATION_ID:<sub-account id>
npx wrangler secret put EV_API_KEY --name ev-highlevel-relay              # our API key
npx wrangler secret put HIGHLEVEL_TOKEN --name ev-highlevel-relay         # the Private Integration token
openssl rand -hex 32                                                      # a new secret for the workflow
npx wrangler secret put HIGHLEVEL_RELAY_SECRET --name ev-highlevel-relay  # paste that secret

Add --var EV_REGION:eu to the deploy command to have addresses validated in the EU and their results stored there.

Then, in the sub-account: Automations > Workflows > + Create Workflow > Start from scratch. Add the trigger Contact Created (and Contact Changed, if changed addresses should be checked too) and a Custom Webhook action set like this (webhook.json holds the same settings):

SettingValue
EventCUSTOM (only that one shows the method, content type and raw body)
MethodPOST
URLyour relay's address, which wrangler deploy prints
AuthorizationBearer Token: your HIGHLEVEL_RELAY_SECRET
Content typeapplication/json
Raw body{"contact_id": "{{contact.id}}"}

If you used Contact Changed, allow re-entry in the workflow's settings, so a contact whose address changes again is sent again. The relay acts only on the exact bearer secret, takes only the contact's id and reads the contact itself. Its own write can start Contact Changed again: it then sees the verdict for that address and checks nothing.

HighLevel lists Custom Webhooks among its premium workflow features: after each sub-account's 100 free lifetime premium executions, each run is charged ($0.01 at the standard rate, per HighLevel's help pages). With Contact Changed, every update of a contact (the relay's own write included) runs the webhook, and HighLevel counts each run as a premium execution, even when the relay checks nothing.

Try it free first

Publish the workflow, and right away create a contact whose address is no_mailbox@sandbox.email-validation.org (pause any of your own workflows that would message a new contact first, or use a test sub-account). Within a few seconds it gets ev_status invalid and ev_action remove. Sandbox checks are free, and that domain receives no mail, so send it nothing. Then delete the test contact.

From the moment the workflow is published, every new contact, and (with Contact Changed) every contact whose address changes, is checked: one credit each (an unknown result is free). A check that gets no answer may have been charged, so the relay does not send it again within the hour; the next script run checks that contact.

If you use only the script, try it first in a test sub-account that holds just that test contact: in your real sub-account, every contact without a verdict is checked, and that is paid.

The contacts you already have: the script

export EV_API_KEY=…  HIGHLEVEL_TOKEN=…  HIGHLEVEL_LOCATION_ID=…
node highlevel.mjs --dry-run                     # counts what it would check; creates, uploads and writes nothing
node highlevel.mjs                               # checks and writes the five fields
node highlevel.mjs --tag invalid,disposable      # also adds the tags ev-invalid and ev-disposable

It checks each contact with an address and no verdict for that address yet (or the verdict unknown). Each checked address uses one credit; unknown results, duplicates and malformed addresses are free. --revalidate also checks contacts that already have a verdict. --region eu validates and keeps the list in the EU.

--tag STATUSES adds our tag for those statuses (ev-invalid, ev-disposable, …); tags are only added, never removed. --dnd STATUSES turns on the contact's email do-not-disturb, only for invalid, catch_all or disposable, and never turns it off again. Both are off by default; the relay takes the same choices as --var EV_TAG_STATUSES:… and --var EV_DND_STATUSES:….

Before each write the script reads the contact again and writes it only when its address is still the one checked. It reads its first write back and stops if anything but our fields changed.

HighLevel allows 100 requests per 10 seconds per Private Integration and sub-account, and 200,000 in 24 hours for all Private Integration tokens of a sub-account (fixed windows from the first counted request; a request refused for the limit does not count; HighLevel can set other limits for an account). The script stays at half the burst limit by default (--rate N, requests a minute, at most 600), which writes about 100 to 150 contacts a minute, plus the bulk list's own time.

Run it again

If a run stops for any reason (your email-validation.org credits ran out, a closed laptop, HighLevel's daily limit, the bulk list still running), run the same command again from the same folder: it picks up the same bulk list and never pays twice (within the 30 days a list is kept). Contacts already written are skipped. After that, each run checks only contacts with no verdict for their address (new contacts, changed addresses, unknown), so you can run it daily or weekly to catch anything the relay did not write.

Exit codes: 0 done, 1 a write failed or the run stopped (run it again), 2 wrong arguments, 75 the bulk list was still running when the script stopped waiting (run it again later).

The script prints counts and ids, never an address or a key.

More on HighLevel

Updated · Maintained by: Email Validation LLC

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