Restrict outgoing Twilio SMS messages to Verified Caller IDs

Viewed 113

By default, Twilio trial accounts can only send SMS to numbers that are listed as Verified Caller IDs in the Twilio console. These numbers have to be added manually, and require a verification message before they can receive SMS. This is an excellent feature for development, as it prevents accidentally sending SMS to wrong numbers.

My problem, is that I am developing for a client whose account is already out of trial status. I don't want the software in development to be able to send text messages to any number, because there is a risk of sending dev messages to the client's actual customers. However, we need to be able to send to some numbers for testing. Is there any way to turn the trial behavior back on? That is, can we somehow configure Twilio to only allow sending SMS to verfied numbers, even if it is not a trial account?

If this isn't possible, I think I can query the Outgoing Caller IDs resource from my program to verify the recipient number against the list before sending. However, this puts the responsibility back on my development team, and the possibility for mistakes remains. I'd like to be able to block the behavior at the Twilio level.

1 Answers

This behavior is only applied for trial accounts, however I'll pass this feedback on internally.

You'll need to replicate this behavior yourself for your applications using an upgraded account. As you mentioned, you can query the Outgoing Caller IDs to get the phone numbers you have already verified with Twilio and use that as an accept list. However, for your use case, you can store and fetch the accept list using whatever way is most convenient for you, like in code, file, database, etc.

Depending on your needs, you could embed this logic directly into your app, or use a single shared library, or create a web API that all other apps have to use to send texts.

Good luck! We can't wait to see what you build!


Update after getting internal feedback.

You can create a new trial account, even with the same Twilio profile, which would give you promotional credits and the same verified Caller ID limits again. The promotional credit should last you a long time for test scenarios.

Related