Protect new mailboxesFresh mailboxes burn fast on a dirty list

Verify every lead before the first send and keep bounces low from day one.

Verify 25 emails free →
Product Bulk verificationReal-time APISignup form widget Catch-all detectionRole and disposable flagsFree email checker
Solutions Cold email agenciesSales teams and SDRsEmail marketersDevelopers and SaaS InstantlySmartleadApollolemlistClayHubSpotMailchimpWoodpeckerReply.ioSaleshandyZapierGoogle SheetsMaken8n All integrations
Mailboxes Google Workspace mailboxesOutlook mailboxesNew cold domain checklist
Compare vs ZeroBouncevs NeverBouncevs Emailable Pricing comparedCredit expiry comparedAll comparisons
Resources GuidesBounce rate benchmarksHow many bounces burn a domain?MX records MX lookupDomain health reportEmail list cleanerAll MX Tools
Pricing
Home / Guides / Verify leads for Instantly via API

Verify leads for Instantly with the Mail Exchange API

If leads reach Instantly from a script, a CRM or an enrichment tool, verify them in the same pipeline. This walkthrough submits a list to the Mail Exchange API, waits for results, and sends only deliverable leads to Instantly's API v2, with catch-alls routed to their own campaign.

Updated 2026-11-24

Illustration for "Verify leads for Instantly with the Mail Exchange API"

TL;DR

  • Verify: POST https://mailexchange.com/api/v1/lists with up to 100,000 addresses, poll GET /v1/lists/{id}, read GET /v1/lists/{id}/results.
  • Filter: keep state == "deliverable"; send risky with reason low_deliverability (catch-all) to a separate campaign; drop undeliverable.
  • Push: Instantly's POST /api/v2/leads/add takes up to 1,000 leads per call, with verify_leads_on_import, skip_if_in_workspace and idempotency_key.
  • Limits: Instantly allows 100 requests per second and 6,000 per minute; both APIs answer 429 when you exceed them and 402 for plan or credit problems.

You have leads flowing from Clay, a scraper, a form or a CRM, and you want them in an Instantly campaign without anyone exporting CSVs. The safe version of that pipeline has one extra step in the middle: verify, then add. There's no ready-made Mail Exchange connector for Instantly yet, so this is the code-it-yourself route. It takes about 60 lines of Python.

What you need

  • A Mail Exchange API key. Sign up, then create an API key in your account (Account > API keys). Reference: email verification API.
  • An Instantly API key. Instantly's quickstart (checked 2026-11-22): Settings > Integrations > API Keys, select the scopes you need, and send it as Authorization: Bearer YOUR_API_KEY to https://api.instantly.ai/api/v2. Adding leads needs one of the scopes leads:create, leads:all, all:create or all:all.
  • Two campaign IDs in Instantly: your main campaign and a separate one for catch-alls.

Step by step: the pipeline

  1. Collect the new leads and remove obvious junk (blank or malformed emails).
  2. Submit the email addresses to POST /v1/lists on the Mail Exchange API.
  3. Poll GET /v1/lists/{id} every 5 to 10 seconds until the status is done, or pass a callback_url and wait for the list.done webhook.
  4. Read GET /v1/lists/{id}/results in pages of up to 10,000 rows.
  5. Split the rows: deliverable to the main campaign, risky with reason low_deliverability to the catch-all campaign, everything else dropped.
  6. Send each group to Instantly with POST /api/v2/leads/add in chunks of up to 1,000 leads, with a fresh idempotency_key per chunk.
  7. Check each response for leads_uploaded, duplicated_leads and invalid_email_count, and log the rest.
Mail Exchange API in the middle, Instantly API v2 at the end. No connector needed.

Step 1-4: verify the list with Mail Exchange

One list holds up to 100,000 unique addresses. Addresses are trimmed and lower-cased, duplicates are removed and not charged, and you're charged one credit per unique address when you submit. Unknown results are refunded when the list finishes. Results come back as JSON (default 1,000 rows, at most 10,000 per request) or CSV. Full detail in verify a list with the API.

import os, time, uuid, requests

MX = "https://mailexchange.com/api/v1"
MX_H = {"Authorization": f"Bearer {os.environ['MAILEXCHANGE_API_KEY']}"}

def verify(emails):
    r = requests.post(f"{MX}/lists", headers=MX_H, json={"emails": emails, "name": "instantly-import"})
    r.raise_for_status()                      # 402 = not enough credits, 400 = over 100,000
    list_id = r.json()["id"]
    while True:
        s = requests.get(f"{MX}/lists/{list_id}", headers=MX_H).json()
        if s["status"] in ("done", "failed"):
            break
        time.sleep(10)                        # polls count toward your rate limit
    rows, offset = [], 0
    while True:
        page = requests.get(f"{MX}/lists/{list_id}/results", headers=MX_H,
                            params={"offset": offset, "limit": 10000}).json()["results"]
        rows += page
        if len(page) < 10000:
            break
        offset += 10000
    requests.delete(f"{MX}/lists/{list_id}", headers=MX_H)   # remove the list and its data
    return rows

Each row has email, state, reason, score, accept_all, role, free, disposable, mx and provider.

Step 5: decide what goes where

Mail Exchange resultWhere it goesWhy
deliverable / accepted_emailMain campaignThe mailbox accepted the address
risky / low_deliverability (catch-all)Catch-all campaignCan't be confirmed; keep its bounces away from the main campaign
risky / low_quality (role address)Usually drop for cold emailinfo@, sales@: rarely the person you want
risky / disposableDropThrowaway inbox
undeliverableDropWill hard-bounce
unknownRetry laterCredit refunded; re-submit in a later run

The split matters because Instantly pauses a campaign above 5% bounces after 200 sends. In Mail Exchange's checks of 779,784 business addresses (17 Oct to 22 Nov 2026, mostly B2B contact lists), 18.1% were catch-all and 7.6% undeliverable, more than enough to trip that brake if they went in unfiltered.

def split(rows):
    main, catch_all = [], []
    for r in rows:
        if r["state"] == "deliverable":
            main.append(r["email"])
        elif r["state"] == "risky" and r["reason"] == "low_deliverability":
            catch_all.append(r["email"])
    return main, catch_all
The same split as the table, as code would see it.

Step 6-7: add the leads to Instantly

From Instantly's add leads in bulk reference (checked 2026-11-22): POST /api/v2/leads/add takes a leads array of 1 to 1,000 objects and either a campaign_id or a list_id, not both. With a campaign, each lead must include email. Useful flags:

  • verify_leads_on_import: runs Instantly's own verification in the background (0.25 credit per lead). Set it to false for leads you've already verified.
  • skip_if_in_workspace: skips leads already anywhere in the workspace and overrides skip_if_in_campaign and skip_if_in_list.
  • idempotency_key: 1-128 characters, makes retries of the same batch safe. Use a new key per batch.
IN = "https://api.instantly.ai/api/v2"
IN_H = {"Authorization": f"Bearer {os.environ['INSTANTLY_API_KEY']}"}

def push(emails, campaign_id):
    for i in range(0, len(emails), 1000):
        chunk = [{"email": e} for e in emails[i:i + 1000]]
        body = {"campaign_id": campaign_id, "leads": chunk,
                "verify_leads_on_import": False, "skip_if_in_workspace": True,
                "idempotency_key": f"mx-{uuid.uuid4()}"}
        r = requests.post(f"{IN}/leads/add", headers=IN_H, json=body)
        if r.status_code == 429:              # rate limited: wait and retry the same body
            time.sleep(5); r = requests.post(f"{IN}/leads/add", headers=IN_H, json=body)
        r.raise_for_status()
        d = r.json()
        print(d["leads_uploaded"], "added,", d["duplicated_leads"], "duplicates,",
              d["invalid_email_count"], "invalid,", d.get("remaining_in_plan"), "left in plan")

rows = verify(new_emails)                      # new_emails: your list of addresses
main, catch_all = split(rows)
push(main, os.environ["INSTANTLY_MAIN_CAMPAIGN"])
push(catch_all, os.environ["INSTANTLY_CATCHALL_CAMPAIGN"])

In real use, carry your other columns through: the lead object accepts first_name, last_name, company_name, job_title, website, personalization and a custom_variables object. Extra properties are rejected. The response always includes leads_uploaded, duplicated_leads, skipped_count, invalid_email_count and in_blocklist; remaining_in_plan appears only when you pass a campaign_id.

Errors, limits and retries

CodeMail ExchangeInstantly
401Missing or wrong keyUnauthorized
402Not enough credits; nothing is createdNo active paid plan
429Per-key rate limit exceededOver 100 requests per second or 6,000 per minute, shared across the workspace

Instantly: rate limits and the add-leads reference, checked 2026-11-22. Mail Exchange: errors, credits and rate limits.

Two practical points. Retry Instantly calls with the same idempotency_key so a timeout never adds a batch twice. And run unknowns again in the next cycle rather than sending them; their credit has already been refunded.

Close the loop with bounce events

Instantly can post webhook events when an email bounces (webhooks need the Hyper Growth plan or above, per Instantly's help center, checked 2026-11-22). Forward those bounces to Mail Exchange's optional POST /v1/feedback endpoint with {"events": [{"email": "...", "event": "bounced"}]}, and add the address to your own suppression list so it's never pushed again. See webhooks and callbacks.

FAQ

Can I verify leads automatically before they reach Instantly?

Yes, with a short script: submit the addresses to the Mail Exchange API, wait for the results, keep the deliverable ones, and add them to an Instantly campaign with POST /api/v2/leads/add. There is no ready-made Mail Exchange connector for Instantly yet.

How many leads can I add to Instantly in one API call?

Instantly's POST /api/v2/leads/add accepts between 1 and 1,000 leads per call, sent to either a campaign_id or a list_id. Larger lists need to be sent in chunks, ideally each with its own idempotency_key.

Should I set verify_leads_on_import when I already verified the leads?

No. verify_leads_on_import runs Instantly's own verification at 0.25 credit per lead. If the leads were already verified with Mail Exchange and filtered to deliverable, set it to false to avoid paying twice.

What are Instantly's API rate limits?

Instantly's API v2 allows no more than 100 requests per second and 6,000 requests per minute, shared across the workspace. Requests over either limit fail with HTTP 429.

To try this, start the free trial (25 checks) and create an API key in your account. API checks use the same monthly verifications as bulk uploads (plans from $49 a month for 10,000), and unknowns are refunded. Prefer no code? Upload the CSV in the app and follow the Instantly workflow.

Start your free trial →