Skip to main content

API Rate Limiting & Optimization

StateSet implements rate limiting to ensure fair usage and maintain service reliability for all users. This guide covers understanding rate limits, implementing efficient request patterns, and optimizing your API usage.

Rate Limit Overview

StateSet uses a sliding window rate limiting algorithm that provides smooth, predictable limits across different time windows.

Per-Second Limits

Prevents burst traffic spikes and ensures responsive service

Per-Minute Limits

Controls sustained request volume over longer periods

Per-Hour Limits

Manages overall API consumption and prevents abuse

Current Rate Limits

By Plan Type

Special Considerations

  • Batch endpoints have higher rate limits but count as multiple requests
  • Each item in a batch counts toward your rate limit
  • Maximum batch size: 100 items per request
  • List endpoints with large limit parameters consume more quota
  • Requests with limit > 100 count as Math.ceil(limit/100) requests
  • Use pagination instead of large limit values
  • Webhook deliveries do not count against your rate limits
  • Failed webhook retries use separate retry quotas
  • Webhook verification calls are not rate limited

Rate Limit Headers

Every API response includes rate limit information in the headers:

Header Descriptions

Implementing Rate Limit Handling

Basic Rate Limit Detection

Advanced Rate Limiting with Queue

Optimization Strategies

1. Efficient Pagination

Instead of requesting large datasets at once:

2. Batch Operations

Use batch endpoints when available:

3. Webhook-First Architecture

Reduce polling by using webhooks:

4. Intelligent Caching

Cache frequently requested data:

Monitoring Rate Limits

Rate Limit Dashboard

Create a monitoring dashboard for your rate limit usage:

Best Practices Summary

Request Optimization

  • Use pagination instead of large limit values
  • Implement batch operations where possible
  • Cache frequently requested data
  • Use webhooks to reduce polling

Error Handling

  • Always check rate limit headers
  • Implement exponential backoff for retries
  • Use queues to manage request flow
  • Monitor and alert on high utilization

Architecture Patterns

  • Design webhook-first integrations
  • Implement circuit breakers for resilience
  • Use separate queues for different priorities
  • Cache aggressively with smart invalidation

Monitoring & Alerting

  • Track utilization across all categories
  • Set alerts at 80% utilization threshold
  • Monitor request success rates
  • Review patterns during peak usage

Getting Help

If you’re consistently hitting rate limits or need higher limits:
  1. Review your usage patterns using the monitoring tools above
  2. Optimize your integration following the strategies in this guide
  3. Consider upgrading to a higher plan with increased limits
  4. Contact support at support@StateSet.com for custom rate limits