Rate Limits
The EZ Texting API enforces a default rate limit of 200 requests per minute. This works well for most use cases.
When You Exceed the Limit
If you exceed the rate limit, the API returns an HTTP 429 Too Many Requests response. The response includes a header that tells you how long to wait before retrying:
X-Rate-Limit-Retry-After-Milliseconds: 1500Retry Logic with Exponential Backoff
Implement a retry strategy that respects the rate limit header. Below are examples of exponential backoff in all supported languages. The pattern: on a 429 response, wait the specified duration, then retry. Double the wait time on each subsequent retry.
#!/bin/bash
retry_with_backoff() {
local max_attempts=5
local attempt=1
local delay=1
while [ $attempt -le $max_attempts ]; do
response=$(curl --request GET \
--url https://a.eztexting.com/v1/contacts \
--header 'accept: application/json' \
--user 'your_username:your_password' \
--write-out '\n%{http_code}')
http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
if [ "$http_code" -lt 429 ]; then
echo "$body"
return 0
fi
if [ $attempt -lt $max_attempts ]; then
echo "Rate limited. Waiting ${delay}s..." >&2
sleep $delay
delay=$((delay * 2))
fi
attempt=$((attempt + 1))
done
return 1
}
retry_with_backoffBest Practices
- Implement exponential backoff — When you receive a
429response, wait the amount of time specified in theX-Rate-Limit-Retry-After-Millisecondsheader before retrying. Do not immediately retry; increase the delay on each subsequent attempt. - Spread requests evenly— Avoid sending all requests at once. Instead, distribute them across the per-minute window to stay under the limit. For example, if you have 1,000 requests to make, send roughly 3–4 per second rather than all at once.
- Use bulk endpoints — Use batch endpoints (like
/v1/contacts/batch) when working with multiple records to reduce the number of API calls. A batch operation counts as one request regardless of how many records are included. - Cache responses— Cache data that doesn't change frequently (like contact groups or keywords) to avoid unnecessary requests. Set reasonable TTLs based on how often the data is updated.
- Monitor your usage— Track how many requests you are making per minute. If you consistently approach the limit, consider optimizing your code or requesting a higher limit from support.
| Limit | Value |
|---|---|
| Default rate limit | 200 requests/minute |
| Rate limit response code | 429 |
| Retry header | X-Rate-Limit-Retry-After-Milliseconds |