API Rate Limiting

Upstat implements rate limiting to ensure fair usage and maintain service quality for all users.

Current Limits

Rate limits vary by subscription plan:

  • Basic: 500 requests per hour
  • Professional: 1,000 requests per hour
  • Business: 5,000 requests per hour
  • Enterprise: Custom limits

![Placeholder: Rate Limit Tiers Comparison Table]

Rate Limit Headers

Every API response includes headers showing your current usage:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1640995200
  • Limit - Your hourly request limit
  • Remaining - Requests left in current window
  • Reset - Unix timestamp when the limit resets

Handling Rate Limits

When you exceed the rate limit, the API returns:

HTTP/1.1 429 Too Many Requests
Retry-After: 3600

{
  "status": "error",
  "message": "Rate limit exceeded",
  "retry_after": 3600
}

Best Practices

Optimize your API usage to avoid hitting limits:

Batch Operations

Instead of individual requests:

# Inefficient - 100 requests
for id in monitor_ids:
  GET /v1/monitors/{id}
  
# Efficient - 1 request  
GET /v1/monitors?ids=id1,id2,id3...

Use Webhooks

Instead of polling for changes:

# Inefficient - polling every minute
while true:
  GET /v1/incidents?status=open
  sleep 60

# Efficient - receive webhooks
Configure webhooks for incident updates

Cache Responses

Cache data that doesn’t change frequently:

  • Monitor configurations
  • Catalog entities
  • Team member lists

Implement Backoff

When approaching limits, implement exponential backoff:

async function apiCall(url, retries = 3) {
  for (let i = 0; i < retries; i++) {
    const response = await fetch(url);
    
    if (response.status === 429) {
      const delay = Math.pow(2, i) * 1000;
      await sleep(delay);
      continue;
    }
    
    return response;
  }
}

Monitoring Usage

Track your API usage:

  1. Check rate limit headers in responses
  2. View usage statistics in account settings
  3. Set up alerts before hitting limits

![Placeholder: API Usage Dashboard Showing Request Trends]

Requesting Higher Limits

If you need higher limits:

  1. Contact support with your use case
  2. Provide expected request volume
  3. Consider upgrading your plan

Rate Limit Scopes

Different endpoints may have different limits:

  • Standard endpoints: Plan limits apply
  • Resource-intensive: Lower limits (e.g., report generation)
  • Real-time: Higher limits (e.g., monitor status checks)

Learn more