// auth and identity
Via APIClerk email verification with pingutil
Clerk can make users verify their email with a code, but temp-mail inboxes receive codes, so verification alone does not stop throwaway accounts. Clerk's own disposable-domain toggle covers its list; a user.created webhook that calls pingutil adds mailbox checks, randomized local parts and risky flags, and bans or tags the user right after creation.
Where it connects: Clerk webhooks, user.created event
What goes wrong without it
- Users pass Clerk's email code with a throwaway inbox and burn through our free credits.
- We turned on Clerk's disposable blocking and still see random-string addresses at domains nobody has heard of.
- We want to know which new users are at real companies without building our own lookup service.
What you can do with Clerk and pingutil
Ban disposable and dead addresses after sign-up
On user.created, verify the primary address. For status invalid, call users.banUser, which per Clerk revokes all sessions and blocks future sign-ins.
Tag risky users in privateMetadata
Write status and reason to privateMetadata so your backend can limit trials for catch-all, role or randomized addresses without blocking them.
Add a second layer to Clerk's disposable toggle
Keep Clerk's "Block sign-ups that use disposable email addresses" on. pingutil adds randomized local-part detection and mailbox status on top of it.
Set it up
- 1
In the Clerk Dashboard, create a webhook endpoint pointing to /api/webhooks/clerk and subscribe it to user.created.
- 2
Copy the endpoint's signing secret into CLERK_WEBHOOK_SIGNING_SECRET and add PINGUTIL_KEY to your environment.
- 3
Add the route handler below to your Next.js app and make the route public in your Clerk middleware.
- 4
Sign up with a disposable address and confirm the user shows as banned in the Clerk Dashboard.
import { verifyWebhook } from '@clerk/nextjs/webhooks';
import { clerkClient } from '@clerk/nextjs/server';
import type { NextRequest } from 'next/server';
export async function POST(req: NextRequest) {
let evt;
try {
evt = await verifyWebhook(req); // uses CLERK_WEBHOOK_SIGNING_SECRET
} catch {
return new Response('Invalid signature', { status: 400 });
}
if (evt.type !== 'user.created') return new Response('ignored');
const user = evt.data;
const email = user.email_addresses.find((e) => e.id === user.primary_email_address_id)?.email_address;
if (!email) return new Response('no email');
let result;
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(10000),
});
// Rate limited or pingutil error: ask Clerk to redeliver later.
if (res.status === 429 || res.status >= 500) return new Response('retry', { status: 503 });
if (!res.ok) return new Response('skipped');
result = await res.json();
} catch {
return new Response('retry', { status: 503 });
}
const clerk = await clerkClient();
if (result.status === 'invalid') {
await clerk.users.banUser(user.id);
} else {
await clerk.users.updateUserMetadata(user.id, {
privateMetadata: { email_status: result.status, email_reason: result.reason },
});
}
return new Response('ok');
}What to do with each result
| pingutil result | Action in Clerk |
|---|---|
| status: "invalid" (disposable_domain, mailbox_not_found, no_mx...) | users.banUser: sessions revoked, no further sign-ins |
| status: "risky" | privateMetadata.email_status = "risky"; limit trial features |
| status: "valid" | privateMetadata.email_status = "valid"; no restriction |
| status: "unknown" | Store it and leave the user alone |
| 429 or 5xx from pingutil | Return 503 so Clerk retries the delivery |
Limits to plan for
- user.created fires after Clerk has created the user, so a throwaway account exists for the seconds until the webhook runs. Clerk also notes webhook deliveries can fail, arrive late, out of order or more than once.
- Retrying on 429 helps with the per-minute limit, but a 429 quota_exceeded lasts until 00:00 UTC; the 300 verified addresses a day (3,000 a month) per account cap how many new users you can check. Those are Free plan limits; Enterprise has custom limits.
- Catch-all domains come back as risky, not valid. Do not ban on risky.
Clerk documentation
- clerk.com/docs/webhooks/sync-data
- clerk.com/docs/reference/backend/user/ban-user
- clerk.com/docs/guides/protect/protections/block-disposable-email-addresses
Clerk is a trademark of its owner. This integration uses Clerk's documented extension points; it is not an official Clerk app.
Common questions
- Clerk already blocks disposable emails. Why add pingutil?
- Clerk's toggle blocks domains on its list. pingutil adds randomized local-part detection, mailbox status with typo suggestions, and a risky status for catch-all and role addresses, which you can use to tag rather than block.
- Can I block before the Clerk user exists?
- Only if you control the sign-up form: call pingutil from your own server action before calling Clerk's sign-up methods. The webhook approach works with Clerk's prebuilt components, after creation.
Stop bad addresses in Clerk 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 Clerk setup will receive.