Rate Limits
To ensure high performance and reliability for all users, SMSBAT applies rate limiting to API requests. Rate limits specify the maximum number of API calls you can make within a given time frame.
Default Limits
Unless otherwise specified in your contract, the default rate limits are applied across all API endpoints (SMSBAT API, Cascade API, and ChatHub API).
| API Category | Default Limit | Burst Limit |
|---|---|---|
Messaging Endpoints (/bat/messagelist) |
100 requests / second | 150 requests / second |
| Data Endpoints (Status, Balance, Info) | 50 requests / second | 75 requests / second |
[!NOTE] For outbound messaging (e.g.,
POST /bat/messagelist), one HTTP request can contain up to 5,000 messages in themessagesarray. The rate limit applies to the number of HTTP requests, not the number of messages sent.
Handling Rate Limits
If you exceed the allowed rate limit, the API will respond with an HTTP 429 Too Many Requests status code.
Response Example
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please wait before sending more requests.",
"status": 429
}
Best Practices
To avoid being rate-limited, consider the following best practices:
- Batch Your Messages: Instead of sending 1,000 separate HTTP requests for 1,000 SMS messages, send a single request containing an array of 1,000 objects.
- Implement Exponential Backoff: If you receive a
429status code, wait for a short period (e.g., 1 second), and try again. If it fails again, double the wait time (2s, 4s, 8s, etc.). - Pace Your Requests: If you are running an automated script that triggers thousands of API calls, introduce a small delay (e.g.,
sleep(10)milliseconds) between requests.
Requesting a Limit Increase
If your use case requires a higher throughput than the default limits, you can request an increase.
- Contact your dedicated account manager or email [email protected].
- Provide your Account ID and the expected throughput (e.g., 500 requests per second).
- Briefly describe your use case.
Our technical team will review your request and adjust your limits accordingly.