// email marketing and newsletters
Via APIMailchimp email verification with pingutil
Mailchimp adds whoever fills in your form, so typos, temp-mail addresses and dead mailboxes sit in the audience until a campaign bounces off them. An audience webhook sends each new subscriber to your endpoint, pingutil checks the mailbox, and the Marketing API archives invalid contacts or tags the risky ones before your next send.
Where it connects: Mailchimp audience webhook (subscribe event) plus the Marketing API list members and member tags endpoints
What goes wrong without it
- Every campaign report shows a handful of hard bounces from people who signed up last week with gmial.com or a mailbox that never existed.
- Our audience count keeps growing but opens stay flat, and a chunk of the new contacts are 10minutemail and guerrillamail addresses.
- We pay for contacts by audience size, so every fake subscriber costs money every month until someone cleans the list by hand.
What you can do with Mailchimp and pingutil
Check subscribers the moment they join
Turn on the subscribe event for your audience webhook. Each new contact is verified in the background and invalid ones are archived before they receive a single campaign.
Tag catch-all and unknown results for a cautious segment
Apply a pingutil-risky or pingutil-unknown tag instead of removing the contact, then build a segment that excludes those tags from cold re-engagement sends.
Clean an older audience before a big campaign
Export the audience as CSV, run it through /v1/verify/batch in chunks of 50 (or the dashboard CSV upload), and re-import the invalid addresses with a tag you exclude, or archive them.
Set it up
- 1
Create a pingutil API key in the dashboard and store it as PINGUTIL_KEY next to your Mailchimp API key and data center prefix (the part after the dash in the key, such as us21).
- 2
Deploy the endpoint below on a server that can keep working after it responds, and protect the URL with a long random path or secret query value.
- 3
In Mailchimp, open the audience, go to Settings, then Webhooks, add your endpoint URL and tick only the subscribe event.
- 4
Subscribe a test address you control and a deliberately misspelled one, then check that the misspelled contact is archived and the real one is tagged pingutil-valid.
- 5
Create a segment that excludes the pingutil-risky and pingutil-unknown tags and use it for campaigns where bounces matter most.
import express from 'express';
import crypto from 'node:crypto';
const app = express();
// Mailchimp sends webhook data form-encoded: type=subscribe&data[email]=...&data[list_id]=...
app.use(express.urlencoded({ extended: true }));
const MC_BASE = 'https://' + process.env.MC_DC + '.api.mailchimp.com/3.0';
const MC_AUTH = 'Basic ' + Buffer.from('anystring:' + process.env.MC_API_KEY).toString('base64');
async function verify(email) {
try {
const res = await fetch('https://pingutil.com/v1/verify', {
method: 'POST',
headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
body: JSON.stringify({ email }),
signal: AbortSignal.timeout(30000), // slow mail servers can take ~25 s
});
if (!res.ok) return null; // 429 quota_exceeded, 5xx: keep the subscriber
return await res.json();
} catch {
return null; // timeout or network error: fail open
}
}
async function mailchimp(method, path, body) {
const res = await fetch(MC_BASE + path, {
method,
headers: { authorization: MC_AUTH, 'content-type': 'application/json' },
body: body ? JSON.stringify(body) : undefined,
});
if (!res.ok) console.error('mailchimp', method, path, res.status);
}
async function handleSubscribe(listId, email) {
const v = await verify(email);
if (!v) return;
const hash = crypto.createHash('md5').update(email.toLowerCase()).digest('hex');
const member = '/lists/' + listId + '/members/' + hash;
if (v.status === 'invalid') {
await mailchimp('DELETE', member); // archives the contact
return;
}
const tags = [{ name: 'pingutil-' + v.status, status: 'active' }];
if (v.did_you_mean) tags.push({ name: 'pingutil-typo', status: 'active' });
await mailchimp('POST', member + '/tags', { tags });
}
app.post('/hooks/mailchimp-' + process.env.HOOK_SECRET, (req, res) => {
// Mailchimp gives up after 10 seconds, so acknowledge first and verify afterwards.
res.sendStatus(200);
if (req.body.type !== 'subscribe') return;
handleSubscribe(req.body.data.list_id, req.body.data.email).catch(console.error);
});
app.listen(3000);What to do with each result
| pingutil result | Action in Mailchimp |
|---|---|
| status: "invalid" (mailbox_not_found, no_mx, disposable_domain) | Archive the member with DELETE on the list member endpoint so no campaign goes to it. |
| status: "risky", reason: "accept_all" | Tag pingutil-risky and keep the contact out of segments where bounces would hurt. |
| status: "unknown" | Tag pingutil-unknown and re-check later; the server did not give a definitive answer. |
| did_you_mean is set | Tag pingutil-typo so someone can email the corrected address or ask the subscriber to confirm. |
| status: "valid" | Tag pingutil-valid and send normally. |
Limits to plan for
- Mailchimp cancels a webhook call that takes more than 10 seconds and retries later, so the endpoint must respond before verifying. Platforms that freeze work after the response (some serverless runtimes) need a queue instead.
- pingutil verifies up to 300 addresses per account per day (3,000 a month), shared with batch and CSV checks. Over that the API returns 429 quota_exceeded and the code above keeps the subscriber untouched. Those are Free plan limits; Enterprise has custom limits.
- Catch-all domains come back as risky with reason accept_all. No SMTP check can confirm a specific mailbox on those servers.
Mailchimp documentation
- mailchimp.com/developer/marketing/guides/sync-audience-data-webhooks/
- mailchimp.com/developer/marketing/api/list-members/
- mailchimp.com/developer/marketing/api/list-member-tags/
Mailchimp is a trademark of its owner. This integration uses Mailchimp's documented extension points; it is not an official Mailchimp app.
Common questions
- Does archiving a Mailchimp contact unsubscribe them?
- Archiving removes the contact from your audience count and from sends, but it is not the same as an unsubscribe. If the person signs up again with a working address later, Mailchimp can add them back.
- Can I verify before the contact is added to Mailchimp at all?
- Yes, if you run your own signup form. Call POST /v1/verify (or /v1/lookup with skip_enrichment for a fast disposable check) in your form handler and only call the Mailchimp members API when the result is not invalid.
Stop bad addresses in Mailchimp today
Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your Mailchimp setup will receive.