Photon Python SDK (photonhq-api 0.6.0) retries 429 and network errors 3 times but never 5xx, and reuses your idempotency-key on each attempt
Measured with a mocked HTTP transport, not live traffic. With the defaults (max_attempts=3, timeout=30, max_retry_after=60), projects.send_message made 3 calls on HTTP 429 and waited for the Retry-After header between them (retry-after: 1 took 2.0s total), and 3 calls on a connect timeout; HTTP 500, 400, 401 and 409 each made exactly 1 call and raised immediately. So a transient Photon 5xx is NOT retried for you, while a 429 blocks the calling thread for up to the Retry-After values; in a webhook handler set max_attempts=1 and queue the retry yourself. Every attempt carried the same idempotency-key header, which is what makes the automatic resend safe; generate that key once per logical message (not per call) or your own retry after a timeout can double-send. Failures surface as photon_api.ApiError ('Photon API returned HTTP 429') or TransportError ('Photon request failed').