// forms and surveys
Via APICognito Forms email verification with pingutil
Cognito Forms is common for registrations, applications and order forms where staff reply by email, so a dead address quietly stalls the process. Its JSON webhook posts each new entry to your Submit Entry Endpoint, where pingutil can verify the address and you can flag or forward the entry. The webhook fires after the entry is saved, so this filters and flags; it cannot stop the submission.
Where it connects: Cognito Forms "Post JSON Data to a Website" webhook (Submit Entry Endpoint)
What goes wrong without it
- Parents register through our Cognito form and some never get the confirmation because of a typo.
- Staff waste time replying to applications whose email bounces back an hour later.
- Our webhook endpoint got hammered with retries after it returned errors during an outage.
What you can do with Cognito Forms and pingutil
Flag registrations with an unreachable email
Post invalid entries to a staff channel with the entry details and did_you_mean, so someone can phone the registrant or fix the address.
Forward only reachable applicants
Send valid and risky entries on to your CRM or case system with the pingutil status attached.
Separate institutional and personal addresses
Use /v1/lookup with skip_enrichment to tag entries as educational, government, company or free webmail.
Set it up
- 1
Create a pingutil key and a random path token; set PINGUTIL_KEY and COGNITO_PATH_TOKEN for your service.
- 2
Deploy the FastAPI handler below.
- 3
In the form's Settings, check Post JSON Data to a Website and set the Submit Entry Endpoint to https://your-host/webhooks/cognito/<token>.
- 4
Point the endpoint at webhook.site first if you want to see the exact JSON keys, then match the email key in the handler (rename keys in Developer Mode if needed).
- 5
Submit a test entry and confirm the status is logged.
import hmac
import os
import httpx
from fastapi import FastAPI, HTTPException, Request
app = FastAPI()
async def verify(client: httpx.AsyncClient, email: str):
try:
r = await client.post(
"https://pingutil.com/v1/verify",
json={"email": email},
headers={"Authorization": f"Bearer {os.environ['PINGUTIL_KEY']}"},
timeout=15,
)
return r.json() if r.status_code == 200 else None
except httpx.HTTPError:
return None # fail open
@app.post("/webhooks/cognito/{token}")
async def cognito_entry(token: str, request: Request):
if not hmac.compare_digest(token, os.environ["COGNITO_PATH_TOKEN"]):
raise HTTPException(status_code=404)
entry = await request.json()
email = str(entry.get("Email") or entry.get("email") or "").strip() # match your field's JSON key
if not email:
return {"ok": True}
async with httpx.AsyncClient() as client:
result = await verify(client, email)
status = result["status"] if result else "unchecked"
target = os.environ["STAFF_ALERT_URL"] if status == "invalid" else os.environ["CRM_WEBHOOK_URL"]
try:
await client.post(target, json={
"cognito_entry_id": entry.get("Id") or entry.get("id"),
"email": email,
"email_status": status,
"did_you_mean": result.get("did_you_mean") if result else None,
}, timeout=10)
except httpx.HTTPError:
pass
# Always 200: Cognito retries 4XX/5XX up to 15 times, and each retry would re-verify.
return {"ok": True}What to do with each result
| pingutil result | Action in Cognito Forms |
|---|---|
| status: "valid" | Forward the entry to your CRM or case system. |
| status: "invalid" | Alert staff with the entry id and did_you_mean. |
| status: "risky" (accept_all) | Forward, noting that delivery cannot be confirmed. |
| status: "unknown" | Forward as unchecked and re-verify later. |
Limits to plan for
- Cognito Forms retries a 4XX or 5XX response up to 15 times over 72 hours. Return 200 even when pingutil fails, or every retry spends another verification.
- Webhooks are a premium Cognito Forms feature and do not fire for entries saved with Save & Resume.
- The JSON post happens after the entry is saved; Cognito does not wait for your endpoint to approve it.
Cognito Forms documentation
Cognito Forms is a trademark of its owner. This integration uses Cognito Forms's documented extension points; it is not an official Cognito Forms app.
Common questions
- How do I secure a Cognito Forms webhook endpoint?
- The Cognito webhook page does not describe a signature. A long random token in the endpoint path, compared in constant time, keeps random requests out.
- Should I verify on the Update Entry Endpoint too?
- Only if the email field can change after submission. Otherwise you spend a verification each time staff edit the entry.
Stop bad addresses in Cognito Forms 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 Cognito Forms setup will receive.