Search code examples
callbacksmstwilio

What is max number of retry attempts for Twilio sms callback?


Twilio has provision for configuring callback URL while sending SMS, which is notified of events relating to changes in the delivery state of SMS.

What happens if my application misses one of these callback events? Say for example when my server is down and the callback request encounters a 502 or 500 response.

Does Twilio retry the callback?

If yes, how many attempts are made before abandoning the event notification?


Solution

  • UPDATE: note that twilio can be configured to retry. add #rc=5 to the end of your webhook url and it will retry 5 times. see https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides for more details


    Twilio developer evangelist here.

    Twilio webhooks (for SMS or phone calls) do not make retry attempts to the same URL if your application fails to respond with a 200 response.

    However, you can supply a fallback URL that Twilio will request with the same parameters if your primary URL fails. We recommend that this fallback URL is not part of the same application so that if your main application is down, you can recover and continue the conversation, save the errors for later or return an error message to your user.

    There is more detail on how best to use fallback URLs on the Twilio site.