// email marketing and newsletters
Via APIKit email verification with pingutil
Kit landing pages and lead magnets attract throwaway addresses and typos that sit in your sequences and count toward your subscriber total. A Kit webhook endpoint subscribed to subscriber.created sends each new subscriber to your server, pingutil checks the mailbox, and the v4 API tags or unsubscribes the subscriber based on the result.
Where it connects: Kit v4 webhook endpoints (subscriber.created event) plus the v4 tag and unsubscribe subscriber endpoints
What goes wrong without it
- Half the people grabbing our free PDF use a temp-mail address, read the download page and vanish, but they still count toward our Kit plan.
- Our first sequence email has a worse bounce rate than anything else we send because nobody checks the address at the form.
- Creators on our team keep asking which subscribers are real before we pitch sponsors on list size.
What you can do with Kit and pingutil
Screen lead-magnet signups
Every subscriber.created event is verified. Disposable and nonexistent addresses are unsubscribed before the incentive email sequence goes out.
Tag risky subscribers instead of dropping them
Catch-all and unknown results get a Kit tag, so you can exclude them from sponsor counts or send them through a re-confirmation email first.
Report a cleaner list size
Filter by the pingutil tags in Kit to see how many subscribers are verified, which is the number worth quoting to sponsors.
Set it up
- 1
Create a pingutil API key, a Kit v4 API key, and two Kit tags (for example pingutil-risky and pingutil-typo); note their tag IDs.
- 2
Deploy the endpoint below on a public HTTPS URL.
- 3
Create the webhook endpoint with POST https://api.kit.com/v4/webhook_endpoints, sending your url and events: ["subscriber.created"]. Store the secret in the response; Kit returns it in plaintext only once.
- 4
Sign up through one of your forms with a test address and check the delivery in Kit's delivery history.
- 5
Confirm that a disposable address ends up unsubscribed and a catch-all address gets the risky tag.
import express from 'express';
import crypto from 'node:crypto';
const app = express();
const KIT = { 'X-Kit-Api-Key': process.env.KIT_API_KEY!, 'Content-Type': 'application/json' };
// X-Kit-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "t.rawBody">
function validSignature(raw: Buffer, header: string | undefined, secret: string) {
const parts = (header ?? '').split(',').map((s) => s.trim());
const t = parts.find((p) => p.startsWith('t='))?.slice(2);
if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = crypto.createHmac('sha256', secret).update(t + '.' + raw.toString('utf8')).digest('hex');
return parts
.filter((p) => p.startsWith('v1='))
.some((p) => {
const got = Buffer.from(p.slice(3));
return got.length === expected.length && crypto.timingSafeEqual(got, Buffer.from(expected));
});
}
async function verify(email: string) {
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),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open: leave the subscriber alone
}
}
async function handle(sub: { id: number; email_address: string }) {
const v = await verify(sub.email_address);
if (!v) return;
if (v.status === 'invalid') {
await fetch('https://api.kit.com/v4/subscribers/' + sub.id + '/unsubscribe', { method: 'POST', headers: KIT, body: '{}' });
return;
}
const tagId = v.did_you_mean ? process.env.KIT_TAG_TYPO : v.status !== 'valid' ? process.env.KIT_TAG_RISKY : null;
if (tagId) {
await fetch('https://api.kit.com/v4/tags/' + tagId + '/subscribers/' + sub.id, { method: 'POST', headers: KIT, body: '{}' });
}
}
app.post('/hooks/kit', express.raw({ type: 'application/json' }), (req, res) => {
if (!validSignature(req.body, req.get('x-kit-signature'), process.env.KIT_WEBHOOK_SECRET!)) return res.sendStatus(401);
res.sendStatus(200); // Kit waits 10 s for a response; do the slow part afterwards
const { events } = JSON.parse(req.body.toString('utf8'));
for (const e of events) {
if (e.type === 'subscriber.created') handle(e.data.subscriber).catch(console.error);
}
});
app.listen(3000);What to do with each result
| pingutil result | Action in Kit |
|---|---|
| status: "invalid" (mailbox_not_found, disposable_domain, no_mx) | POST /v4/subscribers/{id}/unsubscribe; the record and history stay in Kit. |
| status: "risky" or "unknown" | Add the pingutil-risky tag and exclude it from sponsor counts or high-volume broadcasts. |
| did_you_mean is set | Add the pingutil-typo tag so you can follow up with the corrected address. |
| status: "valid" | Leave the subscriber in the sequence as normal. |
Limits to plan for
- Kit waits 10 seconds for your response and retries failures with backoff for about 41 hours, re-sending the whole events array, so acknowledge first and handle each event idempotently by its id.
- A delivery can carry up to 100 events after bulk actions. pingutil checks up to 300 addresses per account per day (3,000 a month); switch to /v1/verify/batch (50 per call) if you expect large bursts. Those are Free plan limits; Enterprise has custom limits.
- Catch-all domains are reported as risky, never valid, because the server accepts every address.
Kit documentation
- developers.kit.com/webhooks/getting-started
- developers.kit.com/webhooks/verifying-signatures
- developers.kit.com/api-reference/tags/tag-a-subscriber
Kit is a trademark of its owner. This integration uses Kit's documented extension points; it is not an official Kit app.
Common questions
- Should I use subscriber.created or subscriber.activated?
- subscriber.created fires as soon as someone signs up, so you can drop bad addresses before your sequence starts. subscriber.activated fires after they confirm, which is later but means the address already received one email.
- Does this work with the legacy /v4/webhooks endpoint?
- Kit recommends /v4/webhook_endpoints for new integrations, and its payload envelope and signature are what the snippet expects. The legacy endpoint uses a different event naming and payload.
Stop bad addresses in Kit 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 Kit setup will receive.