Rate Limits
MoMail implements rate limits to ensure fair usage and platform stability. Limits vary by your subscription plan.
Rate Limit Tiers
Section titled “Rate Limit Tiers”| Plan | Requests per Minute | Requests per Hour | Requests per Day |
|---|---|---|---|
| Free | 20 | 100 | 1,000 |
| Pro | 100 | 2,000 | 20,000 |
| Enterprise | 500 | 10,000 | 100,000 |
Rate Limit Headers
Section titled “Rate Limit Headers”Every API response includes rate limit headers:
X-RateLimit-Limit: 20X-RateLimit-Remaining: 15X-RateLimit-Reset: 1704067200| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the limit resets |
MCP Rate Limits
Section titled “MCP Rate Limits”MCP endpoints have separate rate limits:
| Plan | MCP Requests per Minute |
|---|---|
| Free | 10 |
| Pro | 60 |
| Enterprise | 300 |
Email Processing Limits
Section titled “Email Processing Limits”| Plan | Emails per Day | Max Email Size |
|---|---|---|
| Free | 100 | 10 MB |
| Pro | 10,000 | 25 MB |
| Enterprise | 100,000 | 50 MB |
Exceeding Rate Limits
Section titled “Exceeding Rate Limits”When you exceed a rate limit, the API returns a 429 Too Many Requests response:
{ "success": false, "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Rate limit exceeded. Please try again later.", "details": { "limit": 20, "window": "minute", "retry_after": 45 } }}The response includes a Retry-After header indicating seconds to wait:
Retry-After: 45Best Practices
Section titled “Best Practices”1. Check Headers Before Requests
Section titled “1. Check Headers Before Requests”Monitor rate limit headers to avoid hitting limits:
async function makeRequest(url, options) { const response = await fetch(url, options);
const remaining = response.headers.get('X-RateLimit-Remaining'); const resetTime = response.headers.get('X-RateLimit-Reset');
if (parseInt(remaining) < 5) { console.log(`Rate limit approaching. Resets at ${new Date(resetTime * 1000)}`); }
return response;}2. Implement Exponential Backoff
Section titled “2. Implement Exponential Backoff”When you receive a 429 response, wait before retrying:
import timeimport requests
def request_with_backoff(url, headers, max_retries=3): for attempt in range(max_retries): response = requests.get(url, headers=headers)
if response.status_code == 429: retry_after = int(response.headers.get('Retry-After', 60)) time.sleep(retry_after) continue
return response
raise Exception("Max retries exceeded")3. Use Batching
Section titled “3. Use Batching”Batch operations when possible to reduce API calls:
# Instead of multiple requests, batch operationscurl -X POST https://api.momail.io/v1/search \ -H "X-API-Key: your_key" \ -d '{ "query": "project updates", "limit": 50 }'4. Cache Responses
Section titled “4. Cache Responses”Cache frequently accessed data to reduce API usage:
const CACHE_TTL = 5 * 60 * 1000;
async function getDomains() { const cached = localStorage.getItem('domains'); const cachedTime = localStorage.getItem('domains_time');
if (cached && Date.now() - parseInt(cachedTime) < CACHE_TTL) { return JSON.parse(cached); }
const response = await fetch('/v1/domains', { headers }); const data = await response.json();
localStorage.setItem('domains', JSON.stringify(data)); localStorage.setItem('domains_time', Date.now().toString());
return data;}Increasing Limits
Section titled “Increasing Limits”To increase your rate limits:
- Upgrade your plan: Higher tiers include increased limits
- Contact sales: Enterprise customers can request custom limits
- Optimize usage: Review your integration for inefficiencies
View Pricing Compare plans and upgrade to increase your rate limits