// forms and surveys
Via APIFormspree email verification with pingutil
Formspree is the backend for many static-site contact forms, and every submission arrives in your inbox or tools whether the reply address works or not. A Formspree webhook can post each submission to a function that verifies the address with pingutil after replying, then forwards only reachable leads. Formspree sends webhooks after the submission is accepted, so this is filtering, not blocking.
Where it connects: Formspree webhooks (POST with form, keys and submission)
What goes wrong without it
- We reply to contact form messages from our Jamstack site and a lot of the replies bounce.
- Bots fill the Formspree form with throwaway addresses and our CRM sync picks them up.
- Our webhook handler got the same submission several times and created duplicate leads.
What you can do with Formspree and pingutil
Verify before creating a lead
Forward the submission to your CRM only when the address comes back valid or risky, with the status as a field.
Filter bot traffic on contact forms
Use the fast /v1/lookup check to drop disposable and randomized addresses before they reach anyone's inbox or pipeline.
Tag business inquiries
Add category from the lookup so company addresses go to sales and free webmail goes to the general inbox.
Set it up
- 1
Create a pingutil key and a random FORMSPREE_HOOK_TOKEN, and set both on your Vercel project.
- 2
Deploy the route below to Vercel (Next.js App Router or any framework using Web Request handlers with @vercel/functions).
- 3
In the Formspree dashboard, add a webhook to the form with your route URL and ?token=<FORMSPREE_HOOK_TOKEN>.
- 4
Submit the form and check that the route returns 200 quickly and logs the pingutil result.
- 5
Deduplicate on the email and submission _date in your CRM call, because Formspree can deliver the same submission more than once.
import { waitUntil } from '@vercel/functions';
type Hook = { form: string; keys: string[]; submission: Record<string, string> };
async function pingutil(path: string, body: object, ms: number) {
try {
const res = await fetch('https://pingutil.com' + path, {
method: 'POST',
headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
body: JSON.stringify(body),
signal: AbortSignal.timeout(ms),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open
}
}
async function screen(form: string, submission: Record<string, string>) {
const email = (submission.email ?? '').trim();
if (!email) return;
const fast = await pingutil('/v1/lookup', { input: email, skip_enrichment: true }, 3000);
if (fast?.verdict?.is_spam) return console.log('formspree spam', form, fast.verdict.reason);
const check = await pingutil('/v1/verify', { email }, 20000);
if (check?.status === 'invalid') return console.log('formspree invalid', form, check.reason);
await fetch(process.env.CRM_WEBHOOK_URL!, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
dedupe_key: email + '|' + submission._date, // Formspree may retry the same delivery
email,
message: submission.message ?? '',
email_status: check?.status ?? 'unchecked',
category: fast?.category ?? null,
}),
});
}
export async function POST(req: Request) {
if (new URL(req.url).searchParams.get('token') !== process.env.FORMSPREE_HOOK_TOKEN) {
return new Response('not found', { status: 404 });
}
const { form, submission } = (await req.json()) as Hook;
waitUntil(screen(form, submission));
return new Response('ok'); // Formspree waits 3 seconds before retrying
}What to do with each result
| pingutil result | Action in Formspree |
|---|---|
| verdict.is_spam: true | Drop the submission from lead routing. |
| status: "valid" | Create the lead or ticket. |
| status: "invalid" | Skip the CRM; the message is still in Formspree if you need it. |
| status: "risky" or "unknown" | Create the lead with the status visible. |
| category: "company" | Route to sales instead of the shared inbox. |
Limits to plan for
- Formspree expects a 2xx within 3 seconds and retries up to 10 times. A retried delivery verifies the address again and counts again toward your daily budgets, so reply fast and deduplicate.
- Formspree webhooks are on the Professional and Business plans and are not signed; the token in the URL is your only check.
- The webhook fires after Formspree accepts the submission, so the visitor never sees a verification error.
Formspree documentation
Formspree is a trademark of its owner. This integration uses Formspree's documented extension points; it is not an official Formspree app.
Common questions
- Where is the email in a Formspree webhook?
- In submission, under the name of your form input (usually email), alongside a _date timestamp. The keys array lists field names in submission order.
- Can I verify in the browser before posting to Formspree?
- Not with your API key, which must stay on a server. Keep the check in the webhook, or put a small server route in front of Formspree.
Stop bad addresses in Formspree 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 Formspree setup will receive.