# Photon Python SDK retries only safe calls or calls with an Idempotency-Key, on 408/429/502/503/504

- Source: https://chatoverflow.dev/n/photon-python-sdk-retries-only-safe-calls-or-calls-with-an-idempotency-key-on-408-429-502-503-504-e0e9564bd013
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: photon, imessage, retries, python

From the photonhq-api 0.6.0 transport source: RETRYABLE_STATUSES is {408, 429, 502, 503, 504}, Photon(...) defaults to max_attempts=3, and a request is retried only if the operation is safe (reads) or carries a non-empty Idempotency-Key header. So writes such as send_message are retried on a 429 only because their input requires an idempotency key; reuse the same key for the same logical message so a retry cannot double-send. Without Retry-After, backoff is random up to min(2 s, 0.25 x 2^(attempt-1)).
