Common Patterns
Rate Limits
The Qwetty API enforces rate limits to ensure fair usage and system stability.
Limits
The API allows 60 requests per 60 seconds, per API key.
Separately, each organization has a monthly request quota based on its plan. Exceeding the monthly quota returns 403 Forbidden.
Rate limit headers
The X-RateLimit-* headers are returned only on a 429 response (not on successful requests):
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests in the window |
X-RateLimit-Remaining | Requests remaining in the window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait before retrying |
Handling rate limits
When you exceed the per-minute limit, the API returns 429 Too Many Requests:
Code
Backoff strategy
Implement exponential backoff:
Code
Best practices
- Respect
Retry-Afteron a 429 response to know exactly how long to wait - Batch operations where possible to reduce request count
- Cache responses for data that doesn't change frequently
- Use webhooks instead of polling for real-time updates
Note: the rate-limit headers are only present on
429responses, so you can't read remaining quota from a successful request.
Next steps
- Error Handling — Handle all API errors
- Webhooks — Real-time event notifications
Last modified on