ResourcesRate Limits
Resources

Rate Limits

Understanding Flameup API rate limits and quotas

Overview

Flameup implements rate limiting to ensure fair usage and platform stability. Rate limits are applied per API key and vary by endpoint type.

Rate Limit Tiers

Current Rate Limits

Rate limits are applied globally per API key, not per endpoint:

AuthenticationLimitWindow
Public (no API key)75/minPer IP
Authenticated (API key)120/minPer API key
All endpoints share the same rate limit pool. Plan your request patterns accordingly.

Rate Limit Headers

Every API response includes rate limit information in headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1705320660
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets

Handling Rate Limits

When you exceed the rate limit, you'll receive a 429 Too Many Requests response:

{
  "error": "Rate limit exceeded",
  "message": "Too many requests. Please try again later."
}

The response headers will contain timing information for when you can retry.

Implementing Backoff

class FlameupClient {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.rateLimitRemaining = 1000;
    this.rateLimitReset = null;
  }

  async request(endpoint, options = {}) {
    // Check if we should wait
    if (this.rateLimitRemaining <= 0 && this.rateLimitReset) {
      const waitTime = this.rateLimitReset - Date.now();
      if (waitTime > 0) {
        await this.sleep(waitTime);
      }
    }

    const response = await fetch(endpoint, {
      ...options,
      headers: {
        'Authorization': `Bearer ${this.apiKey}`,
        ...options.headers
      }
    });

    // Update rate limit tracking
    this.rateLimitRemaining = parseInt(
      response.headers.get('X-RateLimit-Remaining') || '1000'
    );
    this.rateLimitReset = parseInt(
      response.headers.get('X-RateLimit-Reset') || '0'
    ) * 1000;

    if (response.status === 429) {
      // Use X-RateLimit-Reset header or default wait time
      const resetTime = parseInt(response.headers.get('X-RateLimit-Reset') || '0') * 1000;
      const waitTime = resetTime > Date.now() ? resetTime - Date.now() : 60000;
      await this.sleep(waitTime);
      return this.request(endpoint, options); // Retry
    }

    return response;
  }

  sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
  }
}

Best Practices

Instead of making individual requests, batch when possible:

// Bad: 100 individual requests
for (const user of users) {
  await flare.createPerson(user);
}

// Good: 1 batch request
await flare.batchUpsertPeople(users);

Batch endpoints are more efficient and have separate, higher limits.

Quota Limits

In addition to rate limits, some operations have quota limits:

ResourceLimitPeriod
People100,000Per workspace
Events10,000,000Per month
Campaigns100Per workspace
API Keys20Per workspace
Device tokens10 per personPer person
Quota limits vary by plan. Contact support to increase limits.

Requesting Higher Limits

If you need higher rate limits:

  1. Optimize your integration - Use batching, caching, and webhooks
  2. Contact support - Explain your use case for limit increases
  3. Upgrade your plan - Higher tiers include higher limits
  4. Enterprise plans - Custom limits available for large-scale deployments
Was this page helpful?
Built with Documentation.AI

Last updated today