Skip to main content

Best Practices for API Rate Limiting in Identity Microservices

Implementing effective API rate limiting is crucial for the stability and security of identity microservices. This guide explores strategies like global and endpoint-specific limits, robust backoff mechanisms, and the importance.

Best Practices for API Rate Limiting in Identity Microservices

Contents

In this guide

Jump to the part you need.

Protect Your ServicesImplement both global and endpoint-specific rate limits to safeguard your identity microservices from abuse and maintain stability, as Didit does with its session-v2-create limits.

Communicate ClearlyUtilize standard HTTP headers like X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After to inform clients about their usage and guide proper handling of 429 responses.

Embrace Backoff StrategiesClients should implement exponential backoff for 429 errors to gracefully handle transient overloads, preventing further strain on the API and ensuring successful retries.

Leverage Pre-built SolutionsDidit's AI-native identity platform provides comprehensive, pre-configured rate limiting, allowing developers to focus on core features rather than building and maintaining complex throttling infrastructure.

The Critical Role of API Rate Limiting in Identity Microservices

In the world of identity microservices, where every request can involve sensitive user data and complex verification processes, API rate limiting isn't just a best practice—it's a necessity. Identity verification, including processes like Didit's ID Verification, Passive & Active Liveness, and AML Screening, demands high availability and robust protection against malicious attacks or accidental overload. Without proper rate limiting, your services are vulnerable to denial-of-service (DoS) attacks, brute-force attempts on credentials, or simply being overwhelmed by legitimate but excessive traffic, leading to degraded performance or complete outages. Implementing a well-thought-out rate limiting strategy ensures fair usage, maintains service stability, and protects your infrastructure.

Designing Effective Rate Limit Policies: Global vs. Endpoint-Specific

A one-size-fits-all approach to rate limiting rarely suffices for complex identity platforms. The most effective strategies combine global limits with more granular, endpoint-specific policies. Global limits provide a baseline defense, catching broad-stroke abuse across your entire API. For instance, Didit applies a global limit of 300 requests per minute per application for both GET and write/delete endpoints. This ensures a general guardrail for all API interactions.

However, certain identity operations are inherently more resource-intensive or critical than others. Creating a new verification session (e.g., using Didit's POST /v2/session/ endpoint for ID Verification or Age Estimation) might require more processing power than simply retrieving a session decision. For such high-impact operations, endpoint-specific limits are essential. Didit, for example, sets a session-v2-create limit at 600 requests per minute and session-decision retrieval at 100 requests per minute. Similarly, generating a PDF (e.g., for compliance records from an AML Screening result) is CPU-bound, warranting its own 100 rpm limit. These specific controls prevent single points of contention from impacting the broader service, allowing you to fine-tune protection where it's most needed.

Communicating and Responding to Rate Limits: Headers and Backoff

Effective rate limiting isn't just about blocking requests; it's also about communicating with your clients. When a client hits a rate limit, your API should respond with an HTTP 429 Too Many Requests status code. Crucially, this response must include informative headers to guide the client on how to proceed. Standard headers like X-RateLimit-Limit (the maximum requests allowed), X-RateLimit-Remaining (requests left in the current window), and X-RateLimit-Reset (when the limit resets, often in epoch seconds) provide transparency. The Retry-After header is particularly important, indicating how long the client should wait before making another request.

On the client side, implementing an exponential backoff strategy for 429 responses is paramount. Instead of immediately retrying a failed request, the client should wait for a progressively longer period (e.g., 5s, then 10s, then 20s) before attempting again. This prevents a cascading effect where retries from an overloaded client further exacerbate the problem. Clients should also monitor X-RateLimit-Remaining and begin throttling requests when usage drops below a certain threshold (e.g., 15% of the limit) to proactively avoid hitting the ceiling. Logging or alerting when retries are triggered helps teams investigate sustained bursts and optimize their API usage patterns.

Building for Scale with Didit's API-First Approach

Integrating identity verification into your application typically involves creating sessions, handling webhooks, and retrieving results. Didit's developer-first philosophy simplifies this complex process, offering clean APIs and comprehensive documentation. When integrating Didit's ID Verification, Passive & Active Liveness, or even Phone & Email Verification, you'll interact with APIs that are already designed with robust rate limiting in mind. For instance, to create a verification session, you'd make a POST request to /v3/session/ with your workflow_id and callback URL. Didit handles the underlying complexity of managing traffic and ensuring stability, so you don't have to build custom rate limiting solutions from scratch.

Didit's modular architecture means you can easily compose verification workflows in the console, then trigger them via API. Whether you're setting up a KYC workflow, an Adaptive Age Verification flow (leveraging Didit's Age Estimation), or a workflow for Biometric Authentication with 1:1 Face Match, the platform provides the infrastructure. This includes the built-in rate limits that automatically protect these high-value operations. For businesses using no-code tools like Zapier, Didit also provides integrations to create sessions or retrieve results, abstracting away the API complexities while still benefiting from the robust backend protection.

How Didit Helps

Didit stands out by offering an AI-native identity platform with robust, pre-configured API rate limiting, allowing you to focus on your core business logic. Our architecture includes both global and endpoint-specific rate limits, ensuring stability and security for all identity microservices, from ID Verification to AML Screening. Didit's API responses clearly communicate rate limit status through standard headers, empowering your developers to build resilient client applications with appropriate backoff strategies. With our modular design, you can easily integrate powerful identity primitives like Passive & Active Liveness, 1:1 Face Match, and NFC Verification without worrying about the underlying infrastructure's stability. Didit provides Core KYC, no setup fees, and a pay-per-successful check model, making advanced identity verification accessible and scalable for businesses of all sizes.

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

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.