Implement adaptive rate-limiting for the Navan REST API with exponential backoff and request queuing.
Use when building bulk data operations or encountering 429 errors from Navan.
Trigger with "navan rate limits", "navan throttling", "navan 429".
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Implement adaptive rate-limiting for the Navan REST API with exponential backoff and request queuing.
Use when building bulk data operations or encountering 429 errors from Navan.
Trigger with "navan rate limits", "navan throttling", "navan 429".
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
version
1.7.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","navan","travel"]
compatibility
Designed for Claude Code
Navan Rate Limits
Overview
Navan does not publicly document its API rate limits. Developers typically discover thresholds empirically when bulk data pulls or batch operations begin returning HTTP 429 responses. This skill implements defensive rate-limiting patterns that adapt to server responses rather than relying on fixed quotas — inspecting response headers, applying exponential backoff with jitter, and queuing requests to prevent flooding.
Prerequisites
Active Navan OAuth 2.0 credentials (see navan-install-auth)
Node.js 18+ (examples use native fetch)
Understanding of HTTP 429 status code and Retry-After header semantics
functionlogRateLimitHeaders(response: Response, endpoint: string): void {
const headers = [
'X-RateLimit-Limit',
'X-RateLimit-Remaining',
'X-RateLimit-Reset',
'Retry-After'
];
constfound: Record<string, string> = {};
for (const h of headers) {
const val = response.headers.get(h);
if (val) found[h] = val;
}
if (Object.keys(found).length > 0) {
console.log(`[${endpoint}] Rate limit headers:`, found);
}
}
Output
A resilient API client that handles Navan's undocumented rate limits through adaptive retry logic and controlled concurrency. The queue prevents bulk operations from triggering 429 responses, and the retry wrapper recovers gracefully when limits are hit.
Error Handling
Error
Code
Solution
Too Many Requests
429
Retry with exponential backoff; inspect Retry-After header
Gateway Timeout
504
Reduce concurrency in queue; retry after 5-10 seconds
Service Unavailable
503
Navan maintenance window; retry with longer backoff (30-60s)
Unauthorized
401
Token expired during long batch operation; refresh OAuth token and retry
Bad Gateway
502
Transient upstream error; retry once after 2 seconds
After implementing rate limiting, see navan-security-basics for credential rotation and token management, or navan-data-sync for building paginated data export pipelines.