Rate Limiting
Rate limiting not yet enforced
The API does not currently apply rate limits. No request will be rejected with HTTP 429 due to volume. This page documents retry best practices for when rate limiting is introduced.
Retry Strategies
Exponential Backoff
When you receive a 429 response, implement exponential backoff:
javascript
async function makeRequestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
if (attempt < maxRetries - 1) {
const delayMs = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
await new Promise(resolve => setTimeout(resolve, delayMs));
continue;
}
}
return response;
} catch (error) {
if (attempt < maxRetries - 1) {
const delayMs = Math.pow(2, attempt) * 1000;
await new Promise(resolve => setTimeout(resolve, delayMs));
} else {
throw error;
}
}
}
}Best Practices
- Batch operations — Use batch endpoints (e.g.,
/patients/batch) to reduce the number of API calls - Cache results — Cache frequently accessed resources locally
- Stagger requests — Spread requests over time rather than sending them all at once
- Monitor usage — Track your API usage to stay well below limits
- Implement jitter — Add random delays to distributed retry attempts to avoid thundering herd
Batch Operations
The /patients/batch endpoint allows you to upsert up to 100 patients in a single call, significantly reducing rate limit pressure compared to individual POST/PUT operations.
