Skip to content

Rate Limiting

CubeConnect enforces rate limits to ensure platform stability. Limits are applied per tenant and vary based on your subscription plan.

Rate Limit Headers

Every API response includes rate limit information:

http
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRemaining requests in the current window

Plan Limits

Rate limits are determined by your subscription plan:

PlanRequests per Minute
Free10
Starter30
Professional60
Enterprise120+

TIP

Contact support to request custom rate limits for high-volume use cases.

Rate Limit Exceeded

When you exceed the rate limit, the API returns a 429 status code:

json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded for your current plan."
  }
}

In addition to per-minute rate limits, the API may return 429 for billing-related restrictions:

Error CodeDescription
RATE_LIMIT_EXCEEDEDToo many requests per minute
PLAN_LIMIT_REACHEDMonthly message quota exhausted
SUBSCRIPTION_EXPIREDSubscription has expired — renew to continue
json
// Plan limit reached
{
  "success": false,
  "error": {
    "code": "PLAN_LIMIT_REACHED",
    "message": "You have reached the message limit for your current plan."
  }
}

// Subscription expired
{
  "success": false,
  "error": {
    "code": "SUBSCRIPTION_EXPIRED",
    "message": "Your subscription has expired."
  }
}

Best Practices

  • Implement exponential backoff — When receiving a 429, wait before retrying and increase the wait time with each retry
  • Queue messages — Instead of sending messages in rapid succession, use a message queue
  • Monitor usage — Track your X-RateLimit-Remaining header to avoid hitting limits
  • Batch operations — Where possible, reduce the total number of API calls

Example: Exponential Backoff

javascript
async function sendWithRetry(payload, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch('https://cubeconnect.io/api/v1/messages/send', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(payload),
    })

    if (response.status !== 429) return response

    const waitTime = Math.pow(2, attempt) * 1000
    await new Promise(resolve => setTimeout(resolve, waitTime))
  }

  throw new Error('Rate limit exceeded after max retries')
}

CubeConnect WhatsApp Business Platform