intercom-rate-limits
Handle Intercom API rate limits with backoff, queuing, and header monitoring. Use when handling 429 errors, implementing retry logic, or optimizing API request throughput for Intercom. Trigger with phrases like "intercom rate limit", "intercom throttling", "intercom 429", "intercom retry", "intercom backoff", "intercom request limit".
What this skill does
# Intercom Rate Limits
## Overview
Intercom enforces rate limits per app and per workspace. Handle 429 errors gracefully with exponential backoff, queue-based throttling, and proactive header monitoring.
## Rate Limit Tiers
| Scope | Limit | Notes |
|-------|-------|-------|
| Private app | 10,000 req/min | Per app |
| Public app (OAuth) | 10,000 req/min | Per app |
| Workspace total | 25,000 req/min | Across all apps |
| Search endpoints | 1,000 req/min | `/contacts/search`, `/conversations/search` |
| Scroll endpoints | 100 req/min | Bulk data export |
## Rate Limit Headers
Every response includes these headers:
```
X-RateLimit-Limit: 10000 # Max requests per window
X-RateLimit-Remaining: 9847 # Remaining requests
X-RateLimit-Reset: 1711100060 # Unix timestamp when window resets
```
## Instructions
### Step 1: Exponential Backoff with Header Awareness
```typescript
import { IntercomClient, IntercomError } from "intercom-client";
async function withRateLimitRetry<T>(
operation: () => Promise<T>,
config = { maxRetries: 5, baseDelayMs: 1000, maxDelayMs: 60000 }
): Promise<T> {
for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
try {
return await operation();
} catch (err) {
if (!(err instanceof IntercomError)) throw err;
if (err.statusCode !== 429 && (err.statusCode ?? 0) < 500) throw err;
if (attempt === config.maxRetries) throw err;
let delayMs: number;
if (err.statusCode === 429) {
// Use X-RateLimit-Reset header for precise wait time
const resetTimestamp = err.headers?.["x-ratelimit-reset"];
if (resetTimestamp) {
delayMs = Math.max(
(parseInt(resetTimestamp) * 1000) - Date.now() + 1000,
1000
);
} else {
delayMs = config.baseDelayMs * Math.pow(2, attempt);
}
} else {
// Server errors: exponential backoff with jitter
delayMs = config.baseDelayMs * Math.pow(2, attempt) + Math.random() * 500;
}
delayMs = Math.min(delayMs, config.maxDelayMs);
console.warn(`[Intercom] ${err.statusCode} - Retry ${attempt + 1}/${config.maxRetries} in ${delayMs}ms`);
await new Promise(r => setTimeout(r, delayMs));
}
}
throw new Error("Unreachable");
}
```
### Step 2: Proactive Rate Limit Monitor
```typescript
class IntercomRateLimitMonitor {
private remaining = 10000;
private limit = 10000;
private resetAt = 0;
updateFromHeaders(headers: Record<string, string>): void {
if (headers["x-ratelimit-remaining"]) {
this.remaining = parseInt(headers["x-ratelimit-remaining"]);
}
if (headers["x-ratelimit-limit"]) {
this.limit = parseInt(headers["x-ratelimit-limit"]);
}
if (headers["x-ratelimit-reset"]) {
this.resetAt = parseInt(headers["x-ratelimit-reset"]) * 1000;
}
}
get usagePercent(): number {
return ((this.limit - this.remaining) / this.limit) * 100;
}
shouldThrottle(threshold = 90): boolean {
return this.usagePercent > threshold && Date.now() < this.resetAt;
}
msUntilReset(): number {
return Math.max(0, this.resetAt - Date.now());
}
async waitIfNeeded(threshold = 90): Promise<void> {
if (this.shouldThrottle(threshold)) {
const waitMs = this.msUntilReset() + 1000;
console.warn(`[Intercom] ${this.usagePercent.toFixed(0)}% rate used, waiting ${waitMs}ms`);
await new Promise(r => setTimeout(r, waitMs));
}
}
}
```
### Step 3: Queue-Based Request Throttling
```typescript
import PQueue from "p-queue";
// Limit to 150 requests/second (well under 10,000/min)
const intercomQueue = new PQueue({
concurrency: 10,
interval: 1000,
intervalCap: 150,
});
async function queuedRequest<T>(operation: () => Promise<T>): Promise<T> {
return intercomQueue.add(() => withRateLimitRetry(operation));
}
// Usage - all requests automatically throttled
const contacts = await Promise.all(
userIds.map(id =>
queuedRequest(() => client.contacts.find({ contactId: id }))
)
);
```
### Step 4: Batch Operations to Reduce Request Count
```typescript
// Instead of N individual contact lookups, use search
async function findContactsByEmails(
client: IntercomClient,
emails: string[]
): Promise<Map<string, any>> {
const results = new Map();
// Search supports up to 50 results per page
// Use OR queries to batch lookups
for (let i = 0; i < emails.length; i += 10) {
const batch = emails.slice(i, i + 10);
const searchResult = await queuedRequest(() =>
client.contacts.search({
query: {
operator: "OR",
value: batch.map(email => ({
field: "email",
operator: "=",
value: email,
})),
},
})
);
for (const contact of searchResult.data) {
results.set(contact.email, contact);
}
}
return results;
}
```
### Step 5: Rate Limit Dashboard Metrics
```typescript
// Track rate limit usage for monitoring
function logRateLimitMetrics(monitor: IntercomRateLimitMonitor): void {
console.log(JSON.stringify({
metric: "intercom.rate_limit",
remaining: monitor["remaining"],
usage_percent: monitor.usagePercent,
ms_until_reset: monitor.msUntilReset(),
timestamp: new Date().toISOString(),
}));
}
```
## Error Handling
| Scenario | Strategy | Implementation |
|----------|----------|----------------|
| 429 with reset header | Wait until reset | Parse `X-RateLimit-Reset` |
| 429 without headers | Exponential backoff | 1s, 2s, 4s, 8s, 16s |
| Approaching limit (>90%) | Proactive throttle | Check remaining before request |
| Bulk operations | Queue-based | `p-queue` with `intervalCap` |
| Multiple apps hitting workspace limit | Coordinate | Shared rate limit monitor |
## Resources
- [Rate Limiting](https://developers.intercom.com/docs/references/rest-api/errors/rate-limiting)
- [Pagination](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination)
- [p-queue](https://github.com/sindresorhus/p-queue)
## Next Steps
For security configuration, see `intercom-security-basics`.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.