Integrations · Forms
Validate emails in Fillout forms
Check the email addresses in your Fillout form submissions. It comes in two pieces; use either or both: a script you run on your own computer checks a form's existing submissions (as one bulk list above 50 addresses), tells you what it will cost and asks before it spends anything, and writes the results to a CSV file; a small relay you deploy to your own Cloudflare account checks each new submission a few seconds after it arrives and reports the result to your own URL or to Slack. Neither changes or deletes anything in Fillout. Download them: email-validation-fillout.zip holds fillout.mjs (the script), relay.mjs (the relay) and the MIT licence.
Fillout stores a submission before its webhook fires, so this cannot refuse an address while someone fills in the form: Fillout's field validation runs inside the form (a pattern or a condition) and calls no outside service. Its API has no call that writes a status onto a submission, so each result is tagged with the submission id. To check an address before you accept it, check it in a form on your own site: see validate a sign-up form.
What you need
- Browser or computer. The relay needs only a browser and a text editor (dashboard steps). The script needs a computer with Node 22.18 or later. Nothing to install: it has no dependencies.
- An API key of ours from the API keys page with Validate addresses, and Bulk lists (off by default: turn it on when you create the key) for more than 50 addresses. With Read balance and usage too, the script shows your balance before it asks. A daily credit cap on the key limits what a busy form can spend through the relay.
- A Fillout API key for the script, which an organization admin can get on any Fillout plan. It covers the whole organization; the script only reads with it.
- For the relay: a Cloudflare account (the relay is a Worker you deploy from the Cloudflare dashboard, or with Cloudflare's
wranglercommand,npx wrangler) and a webhook secret of at least 32 characters, for example fromopenssl rand -hex 32or your password manager's generator.
Check a form's submissions
cd email-validation-fillout # the unzipped folder
export FILLOUT_API_KEY=… EV_API_KEY=…
node fillout.mjs --list # your forms: id, name
node fillout.mjs --form f7Ab2cD9eF --dry-run # how many addresses it would check; spends nothing
node fillout.mjs --form f7Ab2cD9eF # shows the credits and asks, then checksOn Windows, in PowerShell, set the keys with $env:FILLOUT_API_KEY = "…"; $env:EV_API_KEY = "…" and run the same commands.
If your Fillout organization is hosted in Fillout's EU region, add --fillout-region eu. The script reads the form's finished submissions (unfinished ones are left out), shows how many addresses it would check, the most credits the run can use and your balance, and checks only after you answer y. Each address uses one credit; unknown results, malformed addresses and test addresses are free. Up to 50 addresses are checked one by one; more go into one bulk list.
The results go to fillout-f7Ab2cD9eF-results.csv in the folder you run it from, one row per answer and no addresses, so you can join it with Fillout's own export on the submission id:
submission_id,question_id,question_title,status,reason,action,checked_atThe status is valid, invalid, catch_all, unknown or disposable (statuses). Act on the action rather than the status: spam traps and known complainers are valid with the action remove.
Options: --field (one Email question by its id; repeat it for more), --since and --until (a date-time with its zone, such as 2026-11-01T00:00:00Z), --out (another output file), --region eu (validated in the EU, with the same key), --yes (do not ask; needed when it does not run in a terminal), --new-job and --wait-minutes (how long it waits for a bulk list, 240 by default).
Run the same command again later and it checks only the submissions that are new: the output file is the record of what is done, and a bulk list's id is kept beside it, so after any stop the same command resumes that bulk list and it is charged once. Exit codes: 0 done, 1 a check failed or the run stopped early (run it again), 2 wrong arguments, 75 the bulk list was still running (run it again later).
Check each new submission
The relay is a Cloudflare Worker in your own account. No terminal? Deploy it from the Cloudflare dashboard instead. Or deploy it from the unzipped folder:
npx wrangler deploy relay.mjs --name ev-fillout-relay --compatibility-date 2026-10-01
npx wrangler secret put EV_API_KEY --name ev-fillout-relay # our API key
npx wrangler secret put FILLOUT_WEBHOOK_SECRET --name ev-fillout-relay # the webhook secretThe webhook secret is a random string of 32 to 256 letters, digits, _ or - (for example from openssl rand -hex 32). Then add the webhook in Fillout: open the form, select Integrate, then Webhook, and stay in Simple mode. Enter the relay's address with the secret as its path, for example https://ev-fillout-relay.<your subdomain>.workers.dev/<your webhook secret>?form=<form id> (the form part only labels the reports, since Fillout's webhook does not name the form). Fillout does not sign its webhooks, so this address is how the relay knows a delivery came from your form: it answers 401 to any other address and never logs it. Treat the address as a secret. Select Test, then Finish setup, and publish the form.
Do not switch the webhook to Advanced: there Fillout sends only the fields you map by hand, not the submission, and the relay answers 422, so the delivery shows as failed.
For each new submission it checks the answers of the Email questions (at most 5 per submission, a repeated address once) and reports the status, reason and action of each:
- always in the Worker's log, with ids and results only, never the address;
- to a URL of yours and to a Slack incoming webhook, if you set them below.
Submit the form once with no_mailbox@sandbox.email-validation.org to see it work: the log shows invalid with the reason no_mailbox, at no cost. Do it on a form that sends that address no email (no verification code or confirmation email): it receives no mail, and the bounce hurts your sender.
Deploy the relay from the Cloudflare dashboard
- In the Cloudflare dashboard, open Workers & Pages → Create and choose Create Worker. Name it
ev-fillout-relayand select Deploy. - Select Edit code, replace the starter code with the whole of
relay.mjsfrom the unzipped folder (open it in any text editor and copy all of it) and select Deploy. - In the Worker's Settings → Variables and Secrets, add
EV_API_KEYandFILLOUT_WEBHOOK_SECRETas type Secret, and any of the settings below the same way, then Deploy. - The relay's address is on the Worker's page. Add the webhook in Fillout as described above.
Settings
| Setting | What it does |
|---|---|
EV_API_KEY | Our API key (required) |
FILLOUT_WEBHOOK_SECRET | The secret path of the relay's address: 32 to 256 letters, digits, _ or - (required) |
EV_REGION | eu to have addresses validated in the EU and their results stored there (default us) |
EMAIL_FIELDS | Comma-separated question ids of the Email questions to check (default: every Email question) |
FORWARD_URL | An https address of yours that receives each submission's results as JSON |
FORWARD_SECRET | Signs the forward: header X-EV-Signature: sha256=<base64 HMAC-SHA256 of the body> |
SLACK_WEBHOOK_URL | A Slack incoming webhook |
NOTIFY_ON | all (default) or problems: report only the results whose action is not send |
INCLUDE_EMAIL | true to put the address in the forward and the Slack message (default: ids and results only) |
EVENTS | A KV namespace binding (recommended), so a delivery sent again within 24 hours is not checked again by any relay instance |
How the relay answers Fillout
Fillout sends each webhook once and does not retry on its own; a delivery that failed can be sent again from the submission with Retry integration, and an edit through the respondent's edit link sends it again. The relay answers within 9 seconds. Once an address of a submission is checked, it answers with success, and the same submission with the same addresses is not checked again for 24 hours (an edit that changes the address is; across relay instances only with EVENTS bound). If our API is busy, or your key or credits need fixing, it answers with an error and nothing is charged, so Retry integration is safe once it is fixed. A check that timed out may have been charged: that one is answered with success and reported as not checked; run the script with --since to check it. Deliveries sent more than 24 hours ago are not checked.
Nothing here has been run against a real Fillout account yet: it is built from Fillout's public documentation and tested against a stand-in built from it.