Skip to main content

Mastering Webhook Retries & DLQs in Identity Verification

Effectively managing webhook retries and dead letter queues (DLQs) is crucial for robust identity verification systems. This guide explores best practices for ensuring data integrity and system reliability, preventing data loss.

Mastering Webhook Retries & DLQs in Identity Verification

Contents

In this guide

Jump to the part you need.

Implement Robust Retry LogicDesign webhook consumers to automatically reattempt processing failed events using an exponential backoff strategy to prevent system overload and allow for transient issues to resolve.

Utilize Dead Letter Queues (DLQs)Establish a dedicated DLQ for events that exhaust all retry attempts, ensuring no data is lost and allowing for manual inspection and reprocessing of critical failures.

Prioritize IdempotencyEnsure your webhook endpoints are idempotent, meaning that processing the same event multiple times yields the same result, preventing duplicate data or side effects during retries.

Leverage Didit's Built-in ReliabilityDidit simplifies webhook management with secure, reliable delivery, automatic retry mechanisms, and clear status reporting, allowing you to focus on your core business without worrying about missed verification results.

The Importance of Reliable Webhook Handling in KYC

In the world of identity verification and Know Your Customer (KYC) processes, real-time data exchange is paramount. Webhooks serve as the backbone for receiving instant updates from identity verification providers like Didit, signaling crucial events such as a completed ID Verification, a passed Liveness check, or an AML Screening result. However, the internet is an unpredictable place, and temporary network glitches, server overloads, or application errors can cause webhook deliveries to fail. Without a robust strategy for handling these failures, businesses risk data discrepancies, delayed onboarding, and potential compliance issues.

Imagine a scenario where a new user completes their ID Verification using Didit's powerful OCR and biometric tools. If the webhook notifying your system of their successful verification fails, that user might be stuck in a pending state, leading to a poor customer experience and potentially lost revenue. This is where webhook retries and Dead Letter Queues (DLQs) become indispensable. Implementing these mechanisms ensures that your system is resilient, can gracefully recover from failures, and maintains the integrity of your identity verification workflows.

Designing an Effective Webhook Retry Strategy

A well-designed retry strategy is the first line of defense against transient webhook delivery failures. The goal is to reattempt delivery when a failure occurs, but to do so in a way that doesn't overwhelm your system or the sender's. Here are key components of an effective retry strategy:

  • Exponential Backoff: Instead of retrying immediately, wait for increasing intervals between attempts. For example, retry after 1 second, then 2 seconds, then 4 seconds, and so on. This gives your system time to recover from temporary issues without being bombarded by repeated requests.
  • Jitter: Introduce a small, random delay (jitter) to the exponential backoff. This prevents multiple failed webhooks from retrying at the exact same time, which could create a thundering herd problem and overload your system again.
  • Maximum Retries: Define a sensible limit for the number of retry attempts. Infinite retries can lead to resource exhaustion. After a certain number of failed attempts (e.g., 5-10), the event should be considered a persistent failure and moved to a Dead Letter Queue.
  • Retryable vs. Non-Retryable Errors: Distinguish between errors that might resolve on their own (e.g., network timeouts, temporary server unavailability indicated by 5xx HTTP status codes) and those that indicate a permanent problem (e.g., invalid request payload indicated by 4xx status codes). Only retry for the former.

Didit, as a leading identity verification platform, understands the critical nature of reliable communication. Our webhook system is designed with built-in retry mechanisms, ensuring that notifications about successful ID Verification, Passive & Active Liveness checks, and AML Screening results reach your applications even if there are temporary hiccups on your end.

Implementing Dead Letter Queues (DLQs) for Persistent Failures

Even with a robust retry strategy, some webhook deliveries will inevitably fail persistently. These could be due to bugs in your webhook consumer, misconfigurations, or data issues that prevent successful processing. This is where a Dead Letter Queue (DLQ) comes into play. A DLQ is a dedicated queue or storage mechanism for messages that could not be delivered or processed successfully after exhausting all retry attempts.

The primary purpose of a DLQ is to prevent data loss. Instead of discarding failed events, they are moved to the DLQ, where they can be:

  • Inspected Manually: Developers or operations teams can examine the failed events to understand the root cause of the problem.
  • Reprocessed: Once the underlying issue is resolved, events from the DLQ can be manually or programmatically re-injected into the processing pipeline.
  • Archived: For non-critical events or those that cannot be fixed, the DLQ can serve as an archive for auditing or future analysis.

Using a DLQ is a best practice for any event-driven architecture, ensuring that critical identity verification data, whether it's related to ID Verification, 1:1 Face Match, or Proof of Address outcomes, is never silently dropped. When integrating with Didit, setting up your own DLQ for webhook events provides an additional layer of assurance for your compliance and operational needs.

Ensuring Idempotency: Processing Webhooks Without Side Effects

A crucial aspect of handling retries and DLQs is ensuring that your webhook consumer endpoints are idempotent. Idempotency means that performing the same operation multiple times will produce the same result as performing it once. In the context of webhooks, this means that if your system receives the same webhook event multiple times (due to retries), it should not create duplicate records, trigger duplicate actions, or cause other unintended side effects.

To achieve idempotency:

  • Use a Unique Identifier: Every webhook event sent by Didit includes a unique identifier (e.g., session_id). Your system should use this ID to check if an event has already been processed before taking action.
  • Transactional Processing: Wrap your webhook processing logic in a database transaction. If any part of the processing fails, the entire transaction can be rolled back, preventing partial updates.
  • Locking Mechanisms: For highly concurrent systems, consider using distributed locks to ensure that only one instance of your application processes a specific event at a time.

By making your webhook endpoints idempotent, you can confidently allow for retries from Didit's platform and reprocess events from your DLQ without fear of data corruption or inconsistent states. This is fundamental for maintaining the accuracy of your user data, especially when dealing with sensitive information from ID Verification, Age Estimation, or NFC Verification.

How Didit Helps

Didit is engineered to simplify the complexities of identity verification, and that extends to reliable data delivery. Our AI-native, developer-first platform provides robust webhook infrastructure designed to minimize the need for extensive manual handling of retries and failures on your end. Didit's system includes built-in retry logic with exponential backoff, ensuring that verification results for ID Verification, Liveness, 1:1 Face Match, AML Screening, and other services are delivered reliably.

We provide clear webhook documentation and a straightforward API for creating sessions, making it easy to integrate and receive real-time updates. Our modular architecture allows you to compose verification workflows precisely to your needs, and our no-code Business Console makes management intuitive. With Didit, you benefit from:

  • Automated Retries: Didit handles the initial retry attempts for you, reducing the burden on your development team.
  • Secure Delivery: Webhooks are signed, ensuring the integrity and authenticity of the data you receive.
  • Comprehensive Status Updates: Receive detailed notifications for every step of the verification process, from initial submission to final decision.
  • Developer-First Design: Our clean APIs and instant sandbox environment make integration seamless, allowing you to focus on building rather than troubleshooting.
  • Pay per use: Start verifying identities without upfront costs, leveraging our reliable webhook delivery from day one.

By leveraging Didit's platform, you can significantly reduce the overhead associated with managing webhook reliability, allowing your team to focus on leveraging accurate identity verification data to power your applications and onboard users efficiently.

Ready to Get Started?

Ready to see Didit in action? Get a free demo today.

Start verifying identities for free with Didit's free tier.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Blog questions

Who writes the Didit blog?
The Didit team. Guides reviewed by Alberto Rosas, co-founder and CEO, carry his byline. The rest are published as Didit.
Which topics does the blog cover?
Eight topics: ID verification, business verification (KYB), AML, sanctions and compliance, fraud prevention, transaction monitoring and crypto, country guides, agents and developers, and product updates.
Is the blog available in my language?
Yes, in 15 languages: English, Spanish, French, German, Brazilian and European Portuguese, Catalan, Russian, Arabic, Chinese, Japanese, Hindi, Indonesian, Korean and Swahili. Not every post is translated, so each language shows the posts it has.
Where do I find product updates?
In the changelog at /changelog/ and under the Product updates topic.
Are these posts legal advice?
No. Regulation posts explain rules; your legal team decides how they apply.
How do I find posts on one topic?
Open one of the eight topics, or search the blog.
Are posts dated?
Yes. Every post shows when it was published and when it was last updated.
Do posts link to the docs?
Developer posts link to the matching page on docs.didit.me and to the API reference.
Is the blog the same as the docs?
No. The blog explains rules, markets and product changes for a general reader, while docs.didit.me holds the integration guides and the API reference. Developer posts link the matching docs page and the API reference they describe.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.