When an SMS notice fails: retries, returned credits and falling back to e-mail from your system

WhatsApp & APIs·· 38 views· 3 min read

The short answer: when an SMS does not go out, we try twice more, 10 minutes apart. If it still fails, the message becomes failed and the credits go back to your balance. What your system does next is up to you: the most useful step is to send that notice through another channel, such as e-mail.

Refused at once, or failed later

A notice can miss its target in two ways, and each is handled differently:

What happened How you see it What to do
Refused on request The API answers 422 with the reason in details.reason (invalid_number, number_opted_out, insufficient_credits, daily_limit_reached, sender_not_approved…) Fix the cause. Repeating the same request gives the same error.
Accepted, but not sent The status becomes failed, with the error delivery_failed Notify through another channel, or review the customer's number.
Scheduled, balance short at send time The status becomes failed, with the error insufficient_credits Buy credits and schedule again.

The full list of reasons is in SMS API errors and message statuses.

Falling back to e-mail, automatically

1 Save the webhook with the sms.failed event (or both). See the SMS webhook.
2 Store with each notice the SMS id returned on sending and the customer's e-mail address.
3 When an sms.failed arrives, your system finds the notice by id and sends the same content by e-mail.
4 Flag the number as doubtful if it fails repeatedly, and ask the customer to confirm it next time they sign in.
Do not resend the SMS in a loop. We have already retried. Repeating the request unchanged wastes requests, may use credits if the fault was temporary, and a wrong number stays wrong.

Without coding

On the SMS page in My MozOut, filter the History by the Failed status. You see who it was for, the message and the date, and you can reach those customers another way. Filters and statuses are covered in SMS history and scheduling.

Confirm numbers when you collect them. Most failures come from mistyped numbers or numbers no longer in use. A verification code at sign-up catches that early: verification codes through our API.

Want notices that never get lost on the way? See the API page.

See the API page

SEE ALSO

The SMS webhook: how your system learns that each notice was sent or failed

SMS API errors and message statuses: what each one means and what to do

SMS history and scheduling: statuses, filters and what happens when a message fails

SMS, e-mail or WhatsApp for customer notices: which channel for each message

SMS webhook not arriving or rejected: HTTPS, signature, the 5-second answer and retries

Verification codes by SMS through our API: a practical guide for your site or app

RECOMMENDED PRODUCT

Professional e-mail on your domain

Mailboxes in your company name, no adverts, with spam filtering. from ₦9.900,00/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.