Skip to content

Rate Limiting

Mail.td applies rate limits to ensure fair usage and service stability.

Limits

LayerRate LimitKeyed byApplies to
Public endpoints8 req/sIPDomain list, login, registration
Free (authenticated)8 req/sIPEmail operations (/api/accounts/{id}/*)
Pro (authenticated)20 req/sIPSame endpoints, higher limit
Account creation (free)1 per 8sIPPOST /api/accounts without Pro token
Account creation (Pro)8 req/sIPPOST /api/accounts with Pro token

Rate Limit Response

When you exceed the limit, the API returns 429 Too Many Requests:

json
{
  "error": "rate_limit_exceeded"
}

Best Practices

  • Use WebSocket for real-time updates instead of polling GET /api/accounts/{id}/messages repeatedly
  • Cache domain lists — available domains rarely change
  • Use exponential backoff when retrying after a 429
  • Batch operations where possible — don't create/delete accounts in tight loops

Example: Retry with Backoff

javascript
async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const res = await fetch(url, options);
    if (res.status !== 429) return res;

    const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
    await new Promise(r => setTimeout(r, delay));
  }
  throw new Error('Rate limit exceeded after retries');
}

Mail.td API Documentation