Integrations · Email platforms
Validate your Kit subscribers
Check the addresses of a Kit (formerly ConvertKit) audience and save each subscriber's result in four custom fields, 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 every subscriber, a tag, a form or a sequence as one bulk list, and a small relay you deploy to your own Cloudflare account checks each new subscriber as they become active. Neither one deletes or unsubscribes anyone. The script and the relay are in email-validation-kit.zip: kit.mjs (the sync script), relay.mjs (the relay), webhook.json and the MIT licence.
Create a Kit API key
In Kit, open your account settings → Developer and, under V4 Keys, add a new key. Copy it when Kit shows it. Kit documents no permissions for a key, so treat it as access to your whole account and keep it secret. Kit's plans: the API (the sync script) works on every plan, the free one included; webhooks (the relay) need a paid plan. On the free plan, run the script on a schedule instead.
What it writes
| Field | Value |
|---|---|
ev_status | valid, invalid, catch_all, unknown or disposable (statuses) |
ev_reason | why, for example accepted, no_mailbox, spamtrap |
ev_action | send, send_with_caution, remove or retry_later |
ev_checked_at | when the check ran, in UTC |
If your account does not have these custom fields yet, the first run creates them (a Kit account holds at most 140 custom fields: if yours is full, delete one you no longer use first). Make a segment with the custom field filter ev_action matches remove to find every subscriber you should not mail, spam traps and complainers included: they are valid with the action remove, so trust ev_action, not ev_status. Each write changes only these four fields, and sends back the subscriber's address and first name exactly as Kit holds them: no subscriber is created, unsubscribed or deleted. If Kit's answer to a write shows that another custom field lost its value, the script stops at once.
Run it yourself: the sync script
It needs Node 22.18 or later (nothing to install: it has no dependencies), an API key of ours from the API keys page with the permission Bulk lists (off by default: turn it on when you create the key), and the Kit API key above. An audience is all (every subscriber), tag:<id>, form:<id> (a form or landing page) or sequence:<id>; --audiences lists them with their ids and counts. Segments cannot be picked (Kit's API cannot read a segment's subscribers): clean the tag or the whole list it is built from instead.
cd email-validation-kit # the unzipped folder
export EV_API_KEY=… KIT_API_KEY=…
node kit.mjs --audiences # lists the audiences: id, count, name
node kit.mjs --audience tag:<tag id> --dry-run # counts what it would check; spends and writes nothing
node kit.mjs --audience tag:<tag id> # checks and writes the four fieldsTry it free first: in Kit, create a tag named Test that no automation, sequence or form uses. Add one subscriber by hand (not through one of your forms) with the address no_mailbox@sandbox.email-validation.org and tag it Test. It is a test address: free, and it receives no mail, so keep it out of every form, sequence, automation and broadcast that would mail it. Run the script on that tag: the subscriber gets ev_status invalid and ev_action remove. If the run finds nothing to check, the subscriber is not active yet: run it again with --all-states. Then delete the test subscriber in Kit, and run it on your real audience, --dry-run first.
- Only active subscribers are checked (the ones Kit mails), and only those without a result (or with
unknown);--all-statesalso checks unconfirmed, cancelled, bounced and complained ones,--revalidatechecks them all again. --tag-removealso tags the subscribers whose action isremovewithev:remove. They stay subscribed: exclude the tag from your broadcasts, or unsubscribe them yourself in Kit.--region euchecks and keeps the list in the EU, with the same key.node kit.mjs --setuponly creates the four fields.
The script does not ask before it spends: each distinct address uses one credit; unknown results, duplicates, malformed and test addresses are free. It prints subscriber ids, job ids and counts, never an address or a key.
Run it again
Run the same command again after any stop (no credits, a closed laptop, a Kit outage or rate 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, so you can run it on a schedule, for example daily with cron, with both keys set. A subscriber Kit refuses for good is named in a second file beside it (an id and a hash, never the address) and not checked again while its address stays the same.
Kit allows 120 requests a minute per API key, so your other apps using that key count toward it too. The script sends 100 a minute by default (--rate N, at most 120), and each written subscriber takes two: writing back 10,000 subscribers takes about 3 hours 20 minutes. The check itself runs on our side and is not slowed by Kit.
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).
Check new subscribers as they join
The relay is a Cloudflare Worker in your own account, and Kit's webhooks need a paid Kit plan. It needs an API key of ours with Validate addresses (on by default) and your Kit API key. Create the four fields first (a run of the script or node kit.mjs --setup): without them 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-kit-relay --compatibility-date 2026-10-01
npx wrangler secret put EV_API_KEY --name ev-kit-relay # our API key
npx wrangler secret put KIT_API_KEY --name ev-kit-relay # your Kit API keyAdd --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 Kit: open Automation → Webhooks, select + New webhook, enter the relay's address as the Endpoint URL, select the one event type subscriber.activated and select Create webhook. Open the webhook from the Webhooks page and, on its Info tab, select Reveal next to Signing secret. Put it into the relay:
npx wrangler secret put KIT_WEBHOOK_SECRET --name ev-kit-relay # the webhook's signing secret, whsec_…You can also create the webhook through Kit's API: replace the url in webhook.json with the relay's address and send it with curl -H "X-Kit-Api-Key: $KIT_API_KEY" -H 'Content-Type: application/json' --data @webhook.json https://api.kit.com/v4/webhook_endpoints; the answer holds the signing secret.
Keep the webhook on that one event. subscriber.activated fires when a subscriber becomes active (for example on confirming a double opt-in form). To check only subscribers joining one tag, form or sequence, add --var KIT_AUDIENCE:tag:<tag id> (or form:…, sequence:…) to the deploy command and use that join event instead (subscriber.tag_added, subscriber.subscribed_to_form or subscriber.added_to_sequence).
Deploy the relay from the Cloudflare dashboard
- In the Cloudflare dashboard, open Workers & Pages → Create and choose Create Worker (the "Hello World" starter). Name it
ev-kit-relayand select Deploy. - Select Edit code, delete the starter code, paste the whole of
relay.mjsfrom the box below (Copy takes all of it) and select Deploy. - In the Worker's Settings → Variables and Secrets, select Add for each value below, then Deploy:
- type Secret:
EV_API_KEY(our API key),KIT_API_KEY(your Kit API key) and, once you have created the webhook as above,KIT_WEBHOOK_SECRET(its signing secret); - type Text, if you want them:
KIT_AUDIENCE= the one tag, form or sequence to check, andEV_REGION=eu.
- type Secret:
- The relay's address, such as
https://ev-kit-relay.<your-subdomain>.workers.dev/, is on the Worker's page: use it as the webhook's Endpoint URL.
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
Kit signs every delivery with the webhook's secret, and the relay acts only on deliveries signed with it in the last 5 minutes. A subscriber that already has a result is not checked again, so a delivery Kit sends again costs nothing. A large import reaches the relay as large deliveries, of which it checks only a few subscribers: after an import, run the sync, which checks the rest.
Try it once: add a subscriber by hand with another test address, no_dns@sandbox.email-validation.org, kept out of every mail as above (use a new address: a subscriber the script already checked is skipped, so it would prove nothing). Soon after it becomes active it should have ev_status invalid, ev_reason no_dns and ev_action remove. If nothing is written, Kit sent no subscriber.activated for it: Kit's docs do not say whether a subscriber added already active fires it, and the sync checks any subscriber the relay did not. Then delete the test subscriber. From then on every new subscriber who becomes active is a paid check, one credit each.
Good to know
- Ending the access. Delete the webhook in Kit (Automation → Webhooks) and the relay's Worker, and delete the API key in Kit (account settings → Developer).
- Free checks. Results with the status
unknownare free, and so are malformed addresses, duplicates and test addresses.