Clari Rate Limits
Overview
The Clari API enforces rate limits per API key. Export jobs are asynchronous and queued server-side, so the primary concern is polling frequency and concurrent export requests.
Rate Limit Behavior
| Aspect |
Value |
| Scope |
Per API key |
| Response on limit |
HTTP 429 |
| Export job queue |
Server-managed, async |
| Recommended polling |
5-10 second intervals |
Instructions
Exponential Backoff for Export Polling
import time
import requests
def poll_with_backoff(
job_id: str,
api_key: str,
max_attempts: int = 60,
base_delay: float = 5.0,
max_delay: float = 60.0,
) -> dict:
for attempt in range(max_attempts):
resp = requests.get(
f"https://api.clari.com/v4/export/jobs/{job_id}",
headers={"apikey": api_key},
)
if resp.status_code == 429:
retry_after = int(resp.headers.get("Retry-After", base_delay))
time.sleep(retry_after)
continue
resp.raise_for_status()
status = resp.json()
if status["status"] in ("COMPLETED", "FAILED"):
return status
delay = min(base_delay * (1.5 ** attempt), max_delay)
time.sleep(delay)
raise TimeoutError(f"Job {job_id} did not complete in {max_attempts} attempts")
Sequential Export Scheduler
def export_all_periods(
client,
forecast_name: str,
periods: list[str],
delay_between: float = 10.0,
) -> list[dict]:
results = []
for period in periods:
print(f"Exporting {period}...")
job = client.export_forecast(forecast_name, period)
result = poll_with_backoff(job["jobId"], client.config.api_key)
results.append(result)
time.sleep(delay_between) # Avoid hitting rate limits
return results
Error Handling
| Scenario |
Detection |
Response |
| 429 with Retry-After |
Check header |
Wait exact duration |
| 429 without header |
Status code only |
Backoff from 5s |
| Job queue full |
Multiple pending jobs |
Wait for completion before new exports |
Resources
Next Steps
For security configuration, see clari-security-basics.
1---2name: clari-rate-limits3description: |4 Handle Clari API rate limits with backoff and export job scheduling.5 Use when hitting 429 errors, optimizing export frequency,6 or scheduling bulk forecast exports.7 Trigger with phrases like "clari rate limit", "clari 429",8 "clari throttle", "clari api limits".9allowed-tools: Read, Write, Edit10version: 1.0.011license: MIT12author: Jeremy Longshore <jeremy@intentsolutions.io>13tags: [saas, revenue-intelligence, forecasting, clari]14compatible-with: claude-code15---1617# Clari Rate Limits1819## Overview2021The Clari API enforces rate limits per API key. Export jobs are asynchronous and queued server-side, so the primary concern is polling frequency and concurrent export requests.2223## Rate Limit Behavior2425| Aspect | Value |26|--------|-------|27| Scope | Per API key |28| Response on limit | HTTP 429 |29| Export job queue | Server-managed, async |30| Recommended polling | 5-10 second intervals |3132## Instructions3334### Exponential Backoff for Export Polling3536```python37import time38import requests3940def poll_with_backoff(41 job_id: str,42 api_key: str,43 max_attempts: int = 60,44 base_delay: float = 5.0,45 max_delay: float = 60.0,46) -> dict:47 for attempt in range(max_attempts):48 resp = requests.get(49 f"https://api.clari.com/v4/export/jobs/{job_id}",50 headers={"apikey": api_key},51 )5253 if resp.status_code == 429:54 retry_after = int(resp.headers.get("Retry-After", base_delay))55 time.sleep(retry_after)56 continue5758 resp.raise_for_status()59 status = resp.json()6061 if status["status"] in ("COMPLETED", "FAILED"):62 return status6364 delay = min(base_delay * (1.5 ** attempt), max_delay)65 time.sleep(delay)6667 raise TimeoutError(f"Job {job_id} did not complete in {max_attempts} attempts")68```6970### Sequential Export Scheduler7172```python73def export_all_periods(74 client,75 forecast_name: str,76 periods: list[str],77 delay_between: float = 10.0,78) -> list[dict]:79 results = []80 for period in periods:81 print(f"Exporting {period}...")82 job = client.export_forecast(forecast_name, period)83 result = poll_with_backoff(job["jobId"], client.config.api_key)84 results.append(result)85 time.sleep(delay_between) # Avoid hitting rate limits86 return results87```8889## Error Handling9091| Scenario | Detection | Response |92|----------|-----------|----------|93| 429 with Retry-After | Check header | Wait exact duration |94| 429 without header | Status code only | Backoff from 5s |95| Job queue full | Multiple pending jobs | Wait for completion before new exports |9697## Resources9899- [Clari API Reference](https://developer.clari.com/documentation/external_spec)100101## Next Steps102103For security configuration, see `clari-security-basics`.104