# 429 Too Many Requests: back off, dont retry harder

What you see: API calls start returning `429` with an error body saying too many requests. Your Terraform apply, your custom exporter, or your script loop suddenly fails after working fine.

## Why it happens

Datadog rate-limits API endpoints per organization. The usual triggers:

- A script polling an endpoint in a tight loop (metrics queries every second from ten hosts).
- Terraform provider runs against hundreds of monitors in parallel.
- A retry loop without backoff: the first 429 causes immediate retries, which extends the throttle.

## Fix

1. **Stop and wait.** Honor the `Retry-After` header if present. A fixed 60 second pause beats hammering.
2. **Add exponential backoff with jitter** to the client. First retry after a few seconds, doubling, plus randomness so ten hosts do not retry in lockstep.
3. **Reduce call volume.** Cache responses, batch requests, widen poll intervals. If you query the same dashboard data every 10s from CI, you probably need a monitor, not a script.
4. **Split across keys/endpoints** only if the limit is per-key; most are per-org, so this rarely helps. Check which.

## The agent is not this

Agent intake throttling is separate from API 429s. If the *agent* is being throttled, you will see it in `datadog-agent status` as dropped payloads, and the fix is usually fewer custom metrics or a support ticket, not client backoff. Do not confuse the two.

## Trap

Treating 429 as an auth failure and rotating keys. It is not auth. It is pace. Rotating keys mid-throttle just adds a second problem.