{
  "$schema": "https://pinlyx.com/resources/schema/rate-limit-policy.json",
  "version": 1,
  "description": "What to do when X returns 429. The default of retrying immediately is how a single rate-limit event becomes an account-level restriction.",
  "onFirstError": {
    "action": "pause_account",
    "durationSource": "retry_after_header",
    "fallbackDurationSeconds": 900,
    "jitterPercent": 30,
    "note": "Honour Retry-After when it is present. Guess 15 minutes when it is not."
  },
  "onRepeatWithinHours": {
    "window": 6,
    "action": "exponential_backoff",
    "multiplier": 2,
    "maxBackoffMinutes": 240,
    "alsoReduceDailyCapPercent": 25
  },
  "onThirdEventIn24h": {
    "action": "pause_account_24h",
    "notifyOperator": true,
    "reduceDailyCapTo": 400,
    "note": "Three in a day is not bad luck. The caps are wrong."
  },
  "recovery": {
    "resumeAtPercentOfCap": 50,
    "rampBackOverDays": 3,
    "requireCleanHours": 24,
    "note": "Never resume at the full cap. Half, then ramp over three days."
  },
  "neverDo": [
    "Retry immediately on 429. It extends the penalty window.",
    "Switch to another account to finish the same batch. That teaches the platform the accounts are linked.",
    "Ignore a 429 because the send appeared to succeed. It did not."
  ]
}
