The HTTP Timeout Problem
For a standard signup form, verifying one email in real-time (synchronously) is perfect. It takes less than a second. But what if you have a legacy database of 500,000 users that you need to clean before a Black Friday campaign?
If you loop through 500,000 records and make synchronous HTTP requests, your script will timeout. Network latency, server handshakes, and retries will choke your application. You need an Asynchronous architecture.
How Async Verification Works
Instead of keeping the connection open while we check the email (which can take 1-3 seconds for greylisted servers), you submit a batch of emails to us and close the connection immediately. We process the heavy lifting in the background.
- Submit: You POST a list of 1,000 emails to our batch endpoint. We return a `job_id`.
- Process: Our distributed workers verify the list in parallel.
- Callback: Once complete, we send a JSON payload to a URL you provide (the Webhook).
Implementing the Webhook Listener
On your server, you simply need a route (e.g., `/api/email-verification-callback`) that accepts POST requests. This route should:
- Validate the Signature: Ensure the request is actually coming from EmailVerifierAPI.com (security best practice).
- Update Database: Parse the JSON and update your user records based on the `status` field.
The Speed Advantage
By decoupling the request from the response, you eliminate network idle time. You can submit ten batches of 10,000 emails simultaneously. Our infrastructure scales to handle the load, and your server simply waits for the "Ding!" notification when the work is done.
This approach allows you to clean millions of records in hours rather than days, with zero risk of script timeouts or memory exhaustion.