Skip to main content

Didit API Best Practices: Seamless Integration

Learn how to maximize efficiency and security when integrating with the Didit API. This guide covers architecture, error handling, rate limits, and more. Optimize your identity verification workflows today.

Didit API Best Practices: Seamless Integration

Contents

In this guide

Jump to the part you need.

Key Takeaways

Best Standard Practices Prioritize secure API key management, using environment variables and access controls.

API Integration Leverage Didit’s SDKs for simplified integration, but understand the underlying API for custom workflows.

Error Handling Implement robust error handling with retry mechanisms and informative logging for debugging.

Rate Limits Design your application to respect and handle Didit API rate limits gracefully to ensure continuous service.

1. Architectural Considerations for Didit API Integration

Integrating the Didit API into your application requires careful architectural planning. A common approach involves a microservices architecture, where a dedicated “Verification Service” handles all interactions with the Didit API. This isolates the verification logic from your core application and allows for independent scaling and updates. Avoid directly embedding API keys within your frontend code; this is a critical security vulnerability. Instead, your backend servers should communicate with the Didit API, acting as a proxy for your frontend. Consider using an API Gateway to manage authentication, authorization, and rate limiting before requests reach the Verification Service.

Example Architecture:


[Frontend] --(API Request)--> [API Gateway] --(Authentication/Authorization)--> [Verification Service] --(Didit API Request)--> [Didit API]

For high-volume applications, caching verification results can significantly reduce API calls and improve performance. Implement caching strategies based on the sensitivity of the data and the frequency of changes. Remember to invalidate the cache when relevant data is updated.

2. Secure API Key Management: Best Standard Practices

Your Didit API key is a crucial credential. Compromise of this key could lead to unauthorized access and potential fraud. Follow these best practices:

  • Environment Variables: Store your API key in environment variables, not directly in your codebase.
  • Access Control: Restrict access to the environment variables containing your API key to authorized personnel and systems only.
  • Key Rotation: Regularly rotate your API key as a security precaution.
  • Monitoring: Monitor API usage for suspicious activity.
  • Never Commit to Version Control: Ensure your API key is never committed to source control repositories.

Didit provides multiple API keys for different environments (development, staging, production). Utilize these separate keys to isolate environments and prevent accidental production impacts during testing.

3. Effective Error Handling and Retry Mechanisms

API integrations are inherently prone to transient errors. Implement robust error handling to ensure a smooth user experience. The Didit API returns standard HTTP status codes to indicate success or failure. Specifically, pay attention to:

  • 400 Bad Request: Indicates an invalid request. Validate your input data thoroughly.
  • 429 Too Many Requests: Indicates you’ve exceeded the rate limit. Implement exponential backoff retry logic (see section 4).
  • 500 Internal Server Error: Indicates an error on Didit’s side. Implement retry logic with increasing delays.

Implement comprehensive logging to capture error details, request parameters, and timestamps. This information is invaluable for debugging and identifying recurring issues. Utilize a structured logging format (e.g., JSON) for easier analysis.

4. Understanding and Handling Rate Limits

The Didit API enforces rate limits to protect its infrastructure and ensure fair usage. Rate limits are defined as requests per minute (RPM). Exceeding the rate limit will result in a 429 Too Many Requests error. To handle rate limits gracefully:

  • Monitor Rate Limit Headers: The Didit API returns rate limit headers in the response, indicating your current usage and remaining quota.
  • Implement Exponential Backoff: When you receive a 429 error, implement an exponential backoff retry strategy. Start with a short delay (e.g., 1 second) and increase it exponentially with each subsequent retry (e.g., 2 seconds, 4 seconds, 8 seconds).
  • Caching: As mentioned before, caching reduces the number of API calls.
  • Queueing: For high-volume workloads, consider using a message queue to buffer API requests and smooth out bursts of traffic.

5. How Didit Helps

Didit simplifies identity verification through a developer-first approach. Our comprehensive SDKs (Web, iOS, Android, React Native, Flutter) abstract away the complexities of the API, allowing you to integrate verification quickly and easily. However, understanding the underlying API principles discussed above is crucial for building robust and scalable applications. Didit’s Business Console provides detailed analytics and monitoring tools to track API usage and identify potential issues. Our transparent pricing and pay-as-you-go model eliminate hidden fees and unexpected costs.

Ready to Get Started?

Explore the Didit API documentation at https://docs.didit.me and sign up for a free account to start building today! Check out our Demo Center for interactive examples. For specific questions, contact our support team at hello@didit.me.

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

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

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.