Twilio error 30036 means the message was still in the carrier's retry queue when its validity period expired, and the carrier discarded it undelivered rather than attempting further delivery. The validity period is the maximum amount of time a carrier will hold an undelivered message before giving up and returning a final failure status. This error most commonly affects messages sent to recipients whose devices are temporarily unreachable, combined with a validity period that is too short to allow for natural device reconnection.
What Causes This Error
The direct cause is always a mismatch between your ValidityPeriod setting and the actual time required for delivery to succeed on the destination route. Setting ValidityPeriod to a low value (such as 300 seconds or 5 minutes) means that if a recipient's phone is powered off or in a no-coverage area for longer than 5 minutes, the message will expire and return 30036. A second cause is queue backup on the Twilio side: if your message enters the Twilio queue during a high-volume period and takes time to reach the carrier, a short ValidityPeriod may have already partially elapsed by the time the carrier receives it. International messages routed through multiple relay nodes have added latency, and a ValidityPeriod that would be sufficient for a domestic send may expire before the message traverses all international relay hops. Carrier-side infrastructure delays, where the SMSC holds messages longer than usual due to maintenance windows or partial outages, can also cause messages with moderate ValidityPeriod values to expire unexpectedly.
How to Fix It Step by Step
For messages currently failing with 30036, retry them with an increased ValidityPeriod value: set ValidityPeriod to 14400 (4 hours) for time-sensitive transactional messages or 86400 (24 hours) for informational content that remains relevant over a longer window. In your Twilio Messages.create API call, explicitly pass the ValidityPeriod parameter in seconds rather than relying on carrier defaults, as defaults vary significantly between carriers and destinations. For international routes where 30036 is frequent, increase ValidityPeriod to 21600 (6 hours) to account for the additional relay latency and longer carrier hold times common in some international markets. Monitor your queue depth in the Twilio Console under Monitor, then Insights to identify if Twilio-side queue delays are consuming your validity window before messages reach the carrier, and if so, reduce your send throughput to keep queue wait times minimal.
How to Prevent It from Recurring
Set ValidityPeriod explicitly in every API call and calibrate it to your specific use case: OTP codes should use 300 to 600 seconds to remain secure, transactional alerts should use 3600 to 14400 seconds, and marketing messages should use 43200 to 86400 seconds to maximize delivery to recipients who come back online later. Implement a message priority classification in your application so that different message types automatically receive appropriate ValidityPeriod values without requiring manual configuration per send. Monitor your 30036 error rate per destination in your StatusCallback logs and flag destinations or time windows where 30036 rates are above 1 percent, as these signal either a persistent carrier relay latency issue or a ValidityPeriod setting that is too short for that specific route. For high-importance messages where every delivery matters, implement a secondary delivery attempt via an alternative channel such as email or voice when StatusCallback returns 30036, since the message cannot be recovered from the carrier at that point.
When to Call a Specialist
If 30036 errors are occurring with ValidityPeriod set to 3600 or higher on domestic US sends, something unusual is happening in the delivery path: either your Twilio queue has sustained high depth, or a carrier relay is dropping messages from its hold queue faster than it should, both of which require investigation beyond what you can diagnose from the Console alone. For international routes where 30036 rates are consistently above 5 percent despite using ValidityPeriod values of 6 hours or more, a specialist can investigate whether there is a relay-level issue in the specific carrier path and identify whether an alternative routing option would improve delivery. Escalate if 30036 errors appear suddenly on routes that were previously delivering reliably, as this pattern often signals a carrier relay configuration change or a network routing update that has increased latency on that path. Expired messages on critical transactional flows represent permanent data loss with no recovery path.
Conclusion
Error 30036 is a validity window that ran out before delivery completed, and the fix is always to extend that window to match the realistic delivery time for your route and use case. If this error is blocking your production system, contact our team and we will diagnose and fix it within the hour.
Ready to Transform Your Business Communications?
Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.
Comments (0)
Join the discussion and share your thoughts (AI-moderated for quality)
Be the first to comment
No comments yet. Share your thoughts below.