Integrations · Email platforms

Validate your Campaign Monitor subscribers

Check the addresses of a Campaign Monitor list and write each subscriber's result into four custom fields of that list, so a segment can leave out the addresses you should not mail. Two pieces, use either or both: a sync script you run on your own computer checks a whole list as one bulk list, and a small relay you deploy to your own Cloudflare account checks each new subscriber as they join. Neither one adds, deletes, unsubscribes or re-subscribes anyone. Download them: email-validation-campaign-monitor.zip holds campaign-monitor.mjs (the sync script), relay.mjs (the relay), webhook.json and the MIT licence.

What you need

  • A computer for the sync. The sync script needs Node 22.18 or later; nothing to install, it has no dependencies. The relay can be deployed from a terminal or from the Cloudflare dashboard, but its webhook is added with one API call (Campaign Monitor's webhooks are added through its API).
  • An API key of ours from the API keys page: with the permission Bulk lists for the sync (off by default: turn it on when you create the key), with Validate addresses for the relay (on by default). One key can have both.
  • Your Campaign Monitor API key: click your profile image (top right) → Account settings → API keys → Show API key (or Generate API key if there is none yet). Campaign Monitor shows it only to a user with full access and a verified email address. Keep it like a password.
  • For the relay only: a Cloudflare account to run it in (and Cloudflare's wrangler command, npx wrangler, if you deploy it from a terminal).

Try it free first

Use a test list, not your real one: a run checks every subscriber without a result, one credit each.

  1. In Campaign Monitor, create a new list. Give it one custom field of your own of the type Multi-Valued Select Many with two options.
  2. Add one subscriber by hand: Lists & subscribers → the list → Add new subscribers, the line no_mailbox@sandbox.email-validation.org,Yes, with Yes matched to the permission to track. Leave Yes, start the journey unticked. Campaign Monitor sends no confirmation email to a subscriber added by hand, even on a confirmed opt-in list, and the sandbox domain receives no mail: keep that address out of campaigns.
  3. Tick one option of your field for that subscriber.
  4. Run the sync on the test list (below). Test addresses cost nothing. The subscriber gets ev_status invalid and ev_action remove, and keeps the option you ticked. Then delete the test list.

Run the sync

cd email-validation-campaign-monitor                     # the unzipped folder
export EV_API_KEY=…  CAMPAIGN_MONITOR_API_KEY=…
node campaign-monitor.mjs --lists                        # every list the key reaches: ListID, active subscribers, name
node campaign-monitor.mjs --list <ListID> --dry-run      # what it would check; creates, spends and writes nothing
node campaign-monitor.mjs --list <ListID>                # creates the four fields, checks, writes the results

Both keys are needed on every run, a scheduled one included. If --lists does not show the client you want, add --client <client id>. Only active subscribers are checked; unconfirmed, unsubscribed, bounced and deleted ones are not exported. Subscribers that already have a result (other than unknown) are skipped; --revalidate checks them again. --region eu checks and keeps the list in the EU, with the same key.

The sync does not ask before it spends: run it with --dry-run first to see how many subscribers it would check. Each distinct address uses one credit; unknown results, duplicates and malformed addresses are free.

Campaign Monitor records whether each subscriber agreed to have their opens and clicks tracked (Yes or No). It treats a write to a subscriber who has no answer stored as consent given, for every list of the client. So the sync checks and writes only subscribers whose answer is Yes or No, and tells you how many it skipped. Set their answer in Campaign Monitor first if you want them checked.

What it writes

Custom fieldValue
ev_statusvalid, invalid, catch_all, unknown or disposable (statuses)
ev_reasonwhy, for example accepted, no_mailbox, spamtrap
ev_actionsend, send_with_caution, remove or retry_later
ev_checked_atwhen the check ran, in UTC

The first run adds the four fields to the list as Text fields hidden from your preference center (node campaign-monitor.mjs --setup --list <ListID> adds only the fields). Custom fields belong to one list, so each list you clean gets its own four.

Then create a segment of the list with the rule ev_action matches exactly remove, and exclude that segment when you send a campaign to the list: it holds every subscriber not to mail, spam traps and complainers included (they are valid with the action remove).

Each write sends the subscriber's address and name as just read, leaves their tracking consent as it is, never re-subscribes anyone or restarts an automation, and sends the options of the list's Multi-Valued Select Many fields back as they were (Campaign Monitor replaces those with what a write includes, and keeps every other field a write leaves out). It reads its first writes back: if Campaign Monitor changed anything else of a subscriber, the run stops after that subscriber. One whose address changed since the check is not written; the next run checks the new address.

How long it takes

Each written subscriber takes two Campaign Monitor requests. The sync sends 300 a minute by default (about 150 subscribers a minute); --rate N sets another pace, at most 1,200. Campaign Monitor publishes no request limit for these calls; if it answers that the limit is reached, the sync waits as long as it says (up to 10 minutes) and goes on. The check itself runs on our side and is not slowed by Campaign Monitor.

The relay: new subscribers as they join

The relay is a Cloudflare Worker in your own account. One relay serves one list. Run the sync (or --setup) on the list first: without the four fields the relay checks nothing. No terminal? Deploy it from the Cloudflare dashboard instead. Or deploy it from the unzipped folder:

npx wrangler deploy relay.mjs --name ev-campaign-monitor-relay --compatibility-date 2026-10-01 \
  --var CAMPAIGN_MONITOR_LIST_ID:<ListID>
npx wrangler secret put EV_API_KEY --name ev-campaign-monitor-relay                # our API key
npx wrangler secret put CAMPAIGN_MONITOR_API_KEY --name ev-campaign-monitor-relay  # your Campaign Monitor API key
openssl rand -hex 32                                                              # a new secret for the relay's address
npx wrangler secret put RELAY_SECRET --name ev-campaign-monitor-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 add the webhook. In webhook.json, replace the Url with the relay's address and the secret as its path, https://ev-campaign-monitor-relay.<your subdomain>.workers.dev/<secret>, and send it to Campaign Monitor:

curl -u "$CAMPAIGN_MONITOR_API_KEY:x" -H 'Content-Type: application/json' --data @webhook.json \
  https://api.createsend.com/api/v3.3/lists/<ListID>/webhooks.json

It answers with the webhook's id, for the one event Subscribe. To stop the relay, delete that webhook (curl -u "$CAMPAIGN_MONITOR_API_KEY:x" -X DELETE https://api.createsend.com/api/v3.3/lists/<ListID>/webhooks/<webhook id>.json) and the Worker. To end the script's and the relay's access to your account, generate a new API key under Account settings → API keys (Campaign Monitor keeps the old one working for 24 hours: give every other tool that uses it the new key within that time).

Deploy the relay from the Cloudflare dashboard

  1. In the Cloudflare dashboard, open Workers & Pages → Create and choose Create Worker (the "Hello World" starter). Name it ev-campaign-monitor-relay and select Deploy.
  2. Select Edit code, delete the starter code, paste the whole of relay.mjs from the box below (Copy takes all of it) and select Deploy.
  3. In the Worker's Settings → Variables and Secrets, select Add for each value below, then Deploy:
    • type Text: CAMPAIGN_MONITOR_LIST_ID = the list's ListID (and EV_REGION = eu to have addresses validated in the EU and their results stored there);
    • type Secret: EV_API_KEY (our API key), CAMPAIGN_MONITOR_API_KEY (your Campaign Monitor API key) and RELAY_SECRET (32 or more random letters and digits, for example from your password manager's generator).
  4. The relay's address, such as https://ev-campaign-monitor-relay.<your-subdomain>.workers.dev/, is on the Worker's page. Then add the webhook as described above, with your RELAY_SECRET as the address's path.

Or open relay.mjs as plain text in a new tab, select all of it and copy it from there.

Who can call the relay

Campaign Monitor does not sign its webhooks, so the relay protects itself in two ways. It answers only on the secret path, so treat the webhook's address as a secret (if it leaks, make a new secret, add the webhook again with it and delete the old webhook). And it never checks an address only a delivery names: it reads the subscriber from the list with your key and checks only an active subscriber of that list, with a tracking-consent answer and no result yet.

Campaign Monitor sends up to 1,000 events in one delivery (an import sends one per new subscriber). The relay works through what it can in about 20 seconds and leaves the rest without a result: after an import, run the sync.

Try it once: add the test subscriber no_mailbox@sandbox.email-validation.org to the list by hand, as in the free try, with Yes as its permission to track. Within seconds it should have ev_status invalid and ev_action remove. Then delete it. From then on every new subscriber of the list is a paid check, one credit each.

Run it again

Run the same sync command again after any stop (no credits, a closed laptop, Campaign Monitor's limit, the bulk list still running): it resumes the same bulk list and never pays twice (within the 30 days a list is kept). Run it from the same folder each time (or pass the same --state FILE): the file it keeps there holds the bulk list it is working on, never an address or a key. When every subscriber is written, the file is removed and the next run checks only subscribers without a result (or with unknown), such as new ones, so you can run it on a schedule, for example daily with cron, with both keys set.

If a run stops on a write, it keeps the bulk list and exits 1; once you have looked at that subscriber in Campaign Monitor, run it again, or start a new bulk list with --new-job.

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 sync prints counts, job ids and a short hash of each address, never an address or a key; the relay logs nothing.

More on Campaign Monitor

Updated · Maintained by: Email Validation LLC

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