Integrations · Sales outreach
Clean Reply.io contacts before you send
Check the contacts of a Reply.io sequence or contact list before you send, and write each contact's status into its custom fields, so your sequences can leave out the contacts you should not mail. The script reads the contacts, checks them as one bulk list, tells you what it will cost and asks before it spends anything. It never deletes a contact, never removes one from a sequence or list, never opts one out or blocks an address, and never changes any other field. Download it: email-validation-reply-io.zip holds reply-io.mjs, one file, and the MIT licence.
What you need
- A computer with Node 22.18 or later. The script has no browser-only option. Nothing to install: it has no dependencies. With only a browser, export the contacts from Reply.io as a CSV file and upload it as a bulk list on our site instead; you then act on the results file yourself.
- 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). With Read balance and usage too, the script shows your balance before it asks.
- A Reply.io API key: in Reply.io, Settings → API Key. Use a personal key (not an organization key) with the scopes
sequences:read,contacts:readandcontacts:write, andsequences:operatefor--pause-remove. It never needs a delete scope. Keep it like a password.
Run it
cd email-validation-reply-io # the unzipped folder
export EV_API_KEY=… REPLY_API_KEY=…
node reply-io.mjs --lists # your sequences and contact lists, with their ids and contact counts
node reply-io.mjs --sequence <id> --dry-run # what it would check and the most it would cost; spends nothing
node reply-io.mjs --sequence <id> # asks, then checks and writes the statuses back
node reply-io.mjs --list <id> --yes # a contact list, without asking (for a scheduled run)Before it spends, the script shows the contacts it will check, the distinct addresses, the most credits it will use (one per distinct address; unknown results, duplicates and malformed addresses are free), your balance and the custom fields it will create, and asks you to confirm. With --yes it goes on without asking; without a terminal and without --yes it stops before spending.
It checks the contacts that have an address, and skips opted-out contacts and, in a sequence, those that bounced there (--all-contacts checks them too). In a contact list it also skips contacts that already have a status (other than unknown; --revalidate checks them too). In a sequence it checks every such contact on each new run, because Reply.io's listing of a sequence's contacts carries no custom fields: to check only new contacts on a schedule, clean a contact list. --region eu checks and keeps the list in the EU, with the same key.
What it writes
| Contact custom field | Value |
|---|---|
email_validation_status | valid, invalid, catch_all, unknown or disposable (statuses) |
email_validation_action | send, send_with_caution, remove or retry_later |
email_validation_checked_at | when the check finished, in UTC |
The script creates these three text fields in your team the first time, only those that are missing (a dry run creates none). Leave out the contacts whose email_validation_action is remove: that includes spam traps and complainers, which are valid with the action remove. A new check replaces the old values.
Every other field of the contact keeps its value: the script sends only these three fields, and after its first write it compares Reply.io's answer with the contact as it was; if anything else changed, it stops there and says so. It reads each contact again right before it writes: a contact whose address changed since the check is not written (the next run checks its new address), and a contact deleted meanwhile is never created again.
--pause-remove (off unless you add it; sequences only) also pauses, in this sequence, the contacts whose action is remove and that are still being sent to. A paused contact stays in the sequence with all its data and can be set active again in Reply.io. Reply.io lets only the sequence's owner pause its contacts, so use the owner's key for it.
How long it takes
Reply.io limits how many requests a user's key may send, every tool using that key together. The script paces itself below those limits (--rate N requests a minute, 80 by default; --per-hour N, 2,400 by default): writing takes one request per contact plus its fresh read, so a large sequence takes hours, and a contact list about half as long. If your organization bought extra API limits in Reply.io, raise both. The check itself is not slowed by this.
Run it again
Run the same command again after any stop (no credits, a closed laptop, Reply.io's 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). Contacts it already wrote are read again but not written again. 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, and is removed when every contact is written.
If Reply.io refuses a contact for good (a 4xx for that contact) while it accepts the others, the run finishes: the address is recorded in a file next to the state file (<state file>.refused.json: the upload's reference, a code and a hash of the address, never the address), and later runs do not check or charge for it again while it stays the same; a contact whose address changed is checked again. Delete that file to have them checked, and charged, again. When Reply.io refuses most contacts of a run, or answers a 5xx, the run keeps the bulk list and exits 1; run it again later (nothing is charged twice). Refused again then, they are recorded.
Exit codes: 0 done (or you answered no), 1 a write or a pause 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, contact ids, job ids and the names of your sequences and contact lists, never an address or a key.