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

EndpointPer MinutePer HourPer Day
POST /api/v1/sms/send601,00010,000
POST /api/v1/sms/bulk10100500
POST /api/v1/otp/send305005,000
POST /api/v1/whatsapp/send601,00010,000
GET /api/v1/sms/status/*1205,00050,000
POST /api/v1/auth/token202001,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"
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds 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.