hubspot-rate-limits
Implement HubSpot rate limiting, backoff, and request queuing patterns. Use when handling 429 errors, implementing retry logic, or optimizing API throughput against HubSpot rate limits. Trigger with phrases like "hubspot rate limit", "hubspot throttling", "hubspot 429", "hubspot retry", "hubspot backoff", "hubspot quota".
Best use case
hubspot-rate-limits is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement HubSpot rate limiting, backoff, and request queuing patterns. Use when handling 429 errors, implementing retry logic, or optimizing API throughput against HubSpot rate limits. Trigger with phrases like "hubspot rate limit", "hubspot throttling", "hubspot 429", "hubspot retry", "hubspot backoff", "hubspot quota".
Teams using hubspot-rate-limits should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hubspot-rate-limits/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hubspot-rate-limits Compares
| Feature / Agent | hubspot-rate-limits | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement HubSpot rate limiting, backoff, and request queuing patterns. Use when handling 429 errors, implementing retry logic, or optimizing API throughput against HubSpot rate limits. Trigger with phrases like "hubspot rate limit", "hubspot throttling", "hubspot 429", "hubspot retry", "hubspot backoff", "hubspot quota".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# HubSpot Rate Limits
## Overview
Handle HubSpot API rate limits with proper backoff strategies. HubSpot enforces per-second and daily limits shared across all apps in a portal.
## Prerequisites
- `@hubspot/api-client` installed
- Understanding of HubSpot's shared rate limit model
## Instructions
### Step 1: Understand HubSpot Rate Limit Tiers
| Plan | Per-Second Limit | Daily Limit | Burst |
|------|-----------------|-------------|-------|
| Free/Starter | 10 requests/sec | 250,000/day | -- |
| Professional | 10 requests/sec | 500,000/day | -- |
| Enterprise | 10 requests/sec | 500,000/day | -- |
| API Add-on | 10 requests/sec | 1,000,000/day | -- |
**Critical:** Limits are per HubSpot portal (account), not per app. All private apps and OAuth apps in the same portal share the same limit bucket.
### Step 2: Use SDK Built-in Retries
```typescript
import * as hubspot from '@hubspot/api-client';
// The SDK has built-in retry for 429 responses
const client = new hubspot.Client({
accessToken: process.env.HUBSPOT_ACCESS_TOKEN!,
numberOfApiCallRetries: 3, // retries 429 and 5xx automatically
});
```
### Step 3: Custom Backoff with Retry-After Header
```typescript
async function withHubSpotBackoff<T>(
operation: () => Promise<T>,
config = { maxRetries: 5, baseDelayMs: 1000, maxDelayMs: 30000 }
): Promise<T> {
for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
try {
return await operation();
} catch (error: any) {
if (attempt === config.maxRetries) throw error;
const status = error?.code || error?.statusCode || error?.response?.status;
// Only retry on 429 and 5xx
if (status !== 429 && (status < 500 || status >= 600)) throw error;
// Honor Retry-After header from HubSpot
let delay: number;
const retryAfter = error?.response?.headers?.['retry-after'];
if (retryAfter) {
delay = parseInt(retryAfter) * 1000;
} else {
// Exponential backoff with jitter
const exponential = config.baseDelayMs * Math.pow(2, attempt);
const jitter = Math.random() * 500;
delay = Math.min(exponential + jitter, config.maxDelayMs);
}
console.warn(`HubSpot rate limited (attempt ${attempt + 1}/${config.maxRetries}). ` +
`Retrying in ${delay}ms...`);
await new Promise(r => setTimeout(r, delay));
}
}
throw new Error('Unreachable');
}
```
### Step 4: Request Queue for Throughput Control
```typescript
import PQueue from 'p-queue';
// Queue that respects HubSpot's 10 req/sec limit
const hubspotQueue = new PQueue({
concurrency: 5, // max parallel requests
interval: 1000, // per second
intervalCap: 10, // max 10 per interval (HubSpot limit)
});
async function queuedRequest<T>(operation: () => Promise<T>): Promise<T> {
return hubspotQueue.add(operation) as Promise<T>;
}
// Usage -- all calls automatically throttled
const results = await Promise.all(
contactIds.map(id =>
queuedRequest(() =>
client.crm.contacts.basicApi.getById(id, ['email', 'firstname'])
)
)
);
```
### Step 5: Batch Operations to Reduce Call Volume
```typescript
// Instead of 100 individual GET calls (100 API calls):
// BAD
for (const id of contactIds) {
await client.crm.contacts.basicApi.getById(id, ['email']);
}
// Use batch read (1 API call for up to 100 records):
// GOOD - POST /crm/v3/objects/contacts/batch/read
const batchResult = await client.crm.contacts.batchApi.read({
inputs: contactIds.map(id => ({ id })),
properties: ['email', 'firstname', 'lastname'],
propertiesWithHistory: [],
});
console.log(`Fetched ${batchResult.results.length} contacts in 1 API call`);
```
### Step 6: Monitor Rate Limit Headers
```typescript
class HubSpotRateLimitMonitor {
private dailyRemaining = 500000;
private secondlyRemaining = 10;
updateFromResponse(headers: Record<string, string>): void {
if (headers['x-hubspot-ratelimit-daily-remaining']) {
this.dailyRemaining = parseInt(headers['x-hubspot-ratelimit-daily-remaining']);
}
if (headers['x-hubspot-ratelimit-secondly-remaining']) {
this.secondlyRemaining = parseInt(headers['x-hubspot-ratelimit-secondly-remaining']);
}
}
shouldThrottle(): boolean {
return this.secondlyRemaining < 2 || this.dailyRemaining < 1000;
}
getStatus(): { daily: number; secondly: number; warning: boolean } {
return {
daily: this.dailyRemaining,
secondly: this.secondlyRemaining,
warning: this.shouldThrottle(),
};
}
}
```
## Output
- SDK built-in retry handles basic 429s
- Custom backoff honors `Retry-After` header
- Request queue enforces 10 req/sec limit
- Batch operations reduce API call volume by 100x
- Rate limit monitoring prevents threshold breaches
## Error Handling
| Header | Description | Action |
|--------|-------------|--------|
| `X-HubSpot-RateLimit-Daily` | Daily quota | Monitor usage |
| `X-HubSpot-RateLimit-Daily-Remaining` | Remaining today | Alert if < 10% |
| `X-HubSpot-RateLimit-Secondly` | Per-second limit | Always 10 |
| `X-HubSpot-RateLimit-Secondly-Remaining` | Remaining this second | Throttle if < 2 |
| `Retry-After` | Seconds to wait | Always honor this |
## Examples
### Quick Rate Limit Check
```bash
# Check current rate limit state
curl -sI https://api.hubapi.com/crm/v3/objects/contacts?limit=1 \
-H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
| grep -i ratelimit
# Output:
# X-HubSpot-RateLimit-Daily: 500000
# X-HubSpot-RateLimit-Daily-Remaining: 499800
# X-HubSpot-RateLimit-Secondly: 10
# X-HubSpot-RateLimit-Secondly-Remaining: 9
```
## Resources
- [HubSpot API Usage Guidelines](https://developers.hubspot.com/docs/guides/apps/api-usage/usage-details)
- [Error Handling Guide](https://developers.hubspot.com/docs/api-reference/error-handling)
- [p-queue npm](https://github.com/sindresorhus/p-queue)
## Next Steps
For security configuration, see `hubspot-security-basics`.Related Skills
workhuman-rate-limits
Workhuman rate limits for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman rate limits".
wispr-rate-limits
Wispr Flow rate limits for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr rate limits".
windsurf-rate-limits
Understand and manage Windsurf credit system, usage limits, and model selection. Use when running out of credits, optimizing AI usage costs, or understanding the credit-per-model pricing structure. Trigger with phrases like "windsurf credits", "windsurf rate limit", "windsurf usage", "windsurf out of credits", "windsurf model costs".
webflow-rate-limits
Handle Webflow Data API v2 rate limits — per-key limits, Retry-After headers, exponential backoff, request queuing, and bulk endpoint optimization. Use when hitting 429 errors, implementing retry logic, or optimizing API request throughput. Trigger with phrases like "webflow rate limit", "webflow throttling", "webflow 429", "webflow retry", "webflow backoff", "webflow too many requests".
vercel-rate-limits
Handle Vercel API rate limits, implement retry logic, and configure WAF rate limiting. Use when hitting 429 errors, implementing retry logic, or setting up rate limiting for your Vercel-deployed API endpoints. Trigger with phrases like "vercel rate limit", "vercel throttling", "vercel 429", "vercel retry", "vercel backoff", "vercel WAF rate limit".
veeva-rate-limits
Veeva Vault rate limits for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva rate limits".
vastai-rate-limits
Handle Vast.ai API rate limits with backoff and request optimization. Use when encountering 429 errors, implementing retry logic, or optimizing API request throughput. Trigger with phrases like "vastai rate limit", "vastai throttling", "vastai 429", "vastai retry", "vastai backoff".
twinmind-rate-limits
Implement TwinMind rate limiting, backoff, and optimization patterns. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for TwinMind. Trigger with phrases like "twinmind rate limit", "twinmind throttling", "twinmind 429", "twinmind retry", "twinmind backoff".
together-rate-limits
Together AI rate limits for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together rate limits".
techsmith-rate-limits
TechSmith rate limits for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith rate limits".
supabase-rate-limits
Manage Supabase rate limits and quotas across all plan tiers. Use when hitting 429 errors, configuring connection pooling, optimizing API throughput, or understanding tier-specific quotas for Auth, Storage, Realtime, and Edge Functions. Trigger: "supabase rate limit", "supabase 429", "supabase throttle", "supabase quota", "supabase connection pool", "supabase too many requests".
stackblitz-rate-limits
WebContainer resource limits: memory, CPU, file system size, process count. Use when working with WebContainers or StackBlitz SDK. Trigger: "webcontainer limits".