RATE LIMITS
Rate Limits
Rate limits protect the API from abuse and ensure fair usage across all clients. Limits are applied per client/account.
Default Rate Limits
| Endpoint | Per Minute | Per Hour | Per Day |
|---|---|---|---|
| POST /api/v1/sms/send | 60 | 1,000 | 10,000 |
| POST /api/v1/sms/bulk | 10 | 100 | 500 |
| POST /api/v1/otp/send | 30 | 500 | 5,000 |
| POST /api/v1/whatsapp/send | 60 | 1,000 | 10,000 |
| GET /api/v1/sms/status/* | 120 | 5,000 | 50,000 |
| POST /api/v1/auth/token | 20 | 200 | 1,000 |
Rate Limit Headers
Every API response includes rate limit information in the headers:
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 45 X-RateLimit-Reset: 1705147815 X-RateLimit-Policy: 60;w=60;comment="sms_send"
| Header | Description |
|---|---|
| X-RateLimit-Limit | Maximum requests allowed in the current window |
| X-RateLimit-Remaining | Requests remaining in the current window |
| X-RateLimit-Reset | Unix timestamp when the window resets |
| Retry-After | Seconds to wait (only on 429 responses) |
Handling Rate Limits (429)
When you exceed the rate limit, the API returns HTTP 429 Too Many Requests:
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1705147815
Retry-After: 30
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 30 seconds.",
"retry_after": 30
}Implementation Example
import time
import requests
def send_sms_with_retry(to, message, token, max_retries=3):
"""Send SMS with automatic rate limit handling"""
url = "https://api.yourdomain.com/api/v1/sms/send"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
payload = {"to": to, "message": message}
for attempt in range(max_retries):
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 429:
retry_after = int(response.headers.get("Retry-After", 60))
print(f"Rate limited. Waiting {retry_after}s...")
time.sleep(retry_after)
continue
response.raise_for_status()
return response.json()
raise Exception("Max retries exceeded due to rate limiting")Need higher limits?
Contact your administrator to increase rate limits for your account. Enterprise clients can request custom rate limits based on their use case.