Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JanContrerasDev/gestor-contrasenas/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Password Manager API implements rate limiting to ensure fair usage and protect against abuse. Rate limits are applied per IP address for unauthenticated requests.Rate Limit Configuration
The API uses Laravel’s built-in throttle middleware with the following limits:API Rate Limit
60 requests per minute per IP address
/api prefix.
How It Works
- Rate limits are tracked per IP address (
$request->ip()) - For authenticated users, limits could be tracked per user ID
- The limit resets every minute
- When the limit is exceeded, the API returns a
429 Too Many Requestsresponse
Rate Limit Headers
When you make a request to the API, Laravel automatically includes rate limit information in the response headers:The maximum number of requests allowed in the time window (60 per minute)
The number of requests remaining in the current time window
The number of seconds to wait before making another request (only included when rate limit is exceeded)
Rate Limit Exceeded Response
When you exceed the rate limit, the API returns a 429 status code:HTTP 429
Best Practices
Monitor Rate Limit Headers
Monitor Rate Limit Headers
Always check the
X-RateLimit-Remaining header in your responses to track how many requests you have left.Implement Exponential Backoff
Implement Exponential Backoff
When you receive a 429 response, implement exponential backoff retry logic:
Batch Requests Efficiently
Batch Requests Efficiently
Instead of making individual requests in rapid succession, batch your operations:Example Strategy:
- Queue requests in your application
- Process them at a controlled rate (e.g., 50 requests per minute)
- Spread requests evenly across the time window
Cache Responses
Cache Responses
Reduce API calls by implementing client-side caching:
Production Considerations
The current rate limit configuration (60 requests per minute) is suitable for most applications. However, for production environments with high traffic, consider the following:
Recommended Enhancements
-
Authenticated Rate Limits
- Implement user authentication (API keys or tokens)
- Adjust rate limits based on user authentication status
- Allow higher limits for authenticated users
-
Tiered Rate Limits
- Consider different rate limits for different user tiers
- Example: Free tier (60/min), Premium tier (300/min)
-
Endpoint-Specific Limits
- Apply stricter limits to write operations (POST endpoints)
- Allow more generous limits for read operations (GET endpoints)
-
Rate Limit Monitoring
- Track rate limit violations in application logs
- Set up alerts for excessive rate limit hits
- Monitor patterns to identify potential abuse
Example Enhanced Configuration
Testing Rate Limits
To test rate limit behavior in development:Retry-After header.