Test credentials

Twilio provides you with a set of test credentials to access parts of the REST API without charging your account. You can find your credentials in the API Keys & Tokens page of your Console.

The Live credentials are the same with the one on your dashboard

You can use the Test credentials in the same way as your Live credentials. However, you cannot log in to the Twilio CLI with your test credentials.

📘

NOTE:

When you authenticate with your test credentials, we will not charge your account, update the state of your account, or connect to real phone numbers.

You can now pretend to buy a phone number or send an SMS, without actually doing so.

Your test credentials can't interact with the data in your real account. For example, you can't use phone numbers from your real account as the 'From' number in requests made with your test credentials.

Supported Resources

Your test credentials can currently be used to interact with the following three resources:

  • Buying phone numbers: POST /2010-04-01/Accounts/{TestAccountSid}/IncomingPhoneNumbers
  • Sending SMS messages: POST /2010-04-01/Accounts/{TestAccountSid}/Messages
  • Making calls: POST /2010-04-01/Accounts/{TestAccountSid}/Calls

❗️

WARNING:

Requests to any other resource using test credentials will receive a 403 Forbidden response.

In the future, we may enable other resources for testing as well.

❗️

WARNING!

A limitation of SMS messages and calls made using test credentials is that they will not trigger status callbacks. Learn more about status callbacks for outbound SMS and status callbacks for Voice.

Using Magic Input

When you make an API request with your test credentials, Twilio will validate all input as though the request were made with your real credentials. However, there are some cases when a request's validity depends on the state of Twilio. For instance, if you are trying to buy a phone number and that phone number is no longer available, Twilio will return an error.

Therefore, we provide magic inputs as phone number so you can write test cases that expect and handle errors which depend on the state of Twilio. The magic phone number -+15005550000 will always return an error saying the number is unavailable when it is passed as the PhoneNumber parameter in a POST request to IncomingPhoneNumbers.