Key Takeaways
- Flask retry policy against an Android SMS gateway belongs in RQ (or similar) with backoff — not in a view that loops curl.
- Same physics as Django: retry transport, never HTTP 200 accepted. Same Idempotency-Key on every attempt.
- Gunicorn worker timeouts will otherwise double-send. Confirm live JSON in Developer Center.
- We do not ship a Flask SDK. HTTPS/JSON samples only.
- You bring the phone and operator credit. Platform pricing is devices plus send volume.
RQ retries are not radio retries
Hub: Android SMS gateway API. Queue: Flask queue workers. Django sibling (same physics, Celery names): Django retry policies.
Live fields: Developer Center. Flask: flask.palletsprojects.com. We meter devices and volume.
Flask + RQ shape
Route enqueues send_sms(order_id). Job uses Bearer JSON. Failures that are retryable get retry with jitter. Success with an id does not re-queue a send. Webhooks: webhooks.
“If gunicorn killed the view, assume the SIM might already have the job. Idempotency-Key is the apology.”
Retry matrix
| Outcome | Retry? | Notes |
|---|---|---|
| DNS / TLS / 5xx / 429 | Yes, capped | Jitter so many workers don’t sync |
| 4xx body error | No | Dead letter + alert |
| 200 + message id | No send retry | Poll or DLR |
| Worker SIGKILL mid-POST | Yes, same key | At-least-once HTTP; at-most-once SMS via key |
| OTP user tapped resend | Product, not RQ | Cap; isolate device |
Do not retry in the request
Checkout and login routes return immediately. Isolate OTP. Setup: pairing.
USA quiet hours
Promo retries at 02:00 local still look like spam. Transactional OTP is a different lane. Not legal advice. Geo: SMS gateway for the USA. Plans: pricing.
Next steps
Kill a worker mid-send in staging. Confirm one SMS. Operator credit stays yours.
Related product pages
Jump to the live product docs for this topic—not another long-form article.
- SMS API documentationLive endpoint reference
- device and SMS volume pricingPlans and allowances
- Android SMS gateway product guideDefinition, product, and how to buy
- download the Android gateway appGet the APK





