Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Test Credentials


Twilio provides test credentials you can use to exercise parts of the REST API without incurring charges. You can find the credentials on the Auth Tokens page of the Console(link takes you to an external page).

You use test credentials the same way you use your live credentials, except that you can't sign in to the Twilio CLI with them. When you authenticate with test credentials, Twilio doesn't charge your account, update the state of your account, or connect to real phone numbers. You can therefore simulate buying a phone number or sending an SMS without affecting production data.

To protect production data, requests that use test credentials can't interact with resources in your live account. For example, a request made with test credentials can't specify a live account phone number as the From phone number.


Supported resources

supported-resources page anchor

As of now, test credentials can interact with the following resources:

  • Buying phone numbers: POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/IncomingPhoneNumbers
  • Sending SMS messages: POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Messages
  • Making calls: POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Calls
  • Lookup: GET https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}

Requests to any other resource with test credentials return a 403 Forbidden status code. Additional resources might be supported in the future.

(warning)

Warning

SMS messages and calls sent by using test credentials don't trigger status callbacks. Learn more about status callbacks for outbound SMS and status callbacks for Voice.


When you make an API request with test credentials, Twilio validates the input exactly as it does for live credentials. In some cases, request validity depends on Twilio's current state. For example, buying a phone number that has already been purchased returns an error.

To write automated tests that expect specific errors, use magic input values. For instance, the magic phone number +15005550000, when sent as the PhoneNumber parameter in a POST to IncomingPhoneNumbers, always returns the "number unavailable" error.

Magic inputs depend on the endpoint you are testing and are detailed below.


You can test the phone numbers API without provisioning a number or incurring charges by using your test credentials.

Send a POST request to the standard phone-number purchase endpoint, authenticating with your test credentials and using your TestAccountSid in the URL:

POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/IncomingPhoneNumbers

Parameters

test-incoming-phone-numbers-parameters page anchor

All standard phone-number purchase parameters work with test credentials. The following magic input values generate success and failure cases.

PhoneNumber

test-incoming-phone-numbers-parameters-phonenumber page anchor
ValueDescriptionError code
+15005550000Phone number is unavailable.21422
+15005550001Phone number is invalid.21421
+15005550006Phone number is valid and available.No error
ValueDescriptionError code
533No available phone numbers in this area code.21452
500At least one number is available in this area code.No error

Provision a number successfully by purchasing the magic number +15005550006. Any additional parameters, such as VoiceUrl or StatusCallback, are echoed in the response.

Purchase a numberLink to code sample: Purchase a number
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createIncomingPhoneNumber() {
11
const incomingPhoneNumber = await client.incomingPhoneNumbers.create({
12
phoneNumber: "+15005550006",
13
voiceUrl: "http://demo.twilio.com/docs/voice.xml",
14
});
15
16
console.log(incomingPhoneNumber.accountSid);
17
}
18
19
createIncomingPhoneNumber();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"address_requirements": "none",
4
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"api_version": "2010-04-01",
6
"beta": false,
7
"capabilities": {
8
"voice": true,
9
"sms": false,
10
"mms": true,
11
"fax": false
12
},
13
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
14
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
15
"emergency_status": "Active",
16
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"emergency_address_status": "registered",
18
"friendly_name": "friendly_name",
19
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"origin": "origin",
21
"phone_number": "+15005550006",
22
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
23
"sms_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
24
"sms_fallback_method": "GET",
25
"sms_fallback_url": "https://example.com",
26
"sms_method": "GET",
27
"sms_url": "https://example.com",
28
"status_callback": "https://example.com",
29
"status_callback_method": "GET",
30
"trunk_sid": null,
31
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
32
"voice_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
"voice_caller_id_lookup": false,
34
"voice_fallback_method": "GET",
35
"voice_fallback_url": "https://example.com",
36
"voice_method": "GET",
37
"voice_url": "http://demo.twilio.com/docs/voice.xml",
38
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
"voice_receive_mode": "voice",
40
"status": "in-use"
41
}

Attempt to purchase an unavailable number by passing the magic number +15005550000.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createIncomingPhoneNumber() {
11
const incomingPhoneNumber = await client.incomingPhoneNumbers.create({
12
phoneNumber: "+15005550000",
13
});
14
15
console.log(incomingPhoneNumber.accountSid);
16
}
17
18
createIncomingPhoneNumber();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"address_requirements": "none",
4
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"api_version": "2010-04-01",
6
"beta": false,
7
"capabilities": {
8
"voice": true,
9
"sms": false,
10
"mms": true,
11
"fax": false
12
},
13
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
14
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
15
"emergency_status": "Active",
16
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"emergency_address_status": "registered",
18
"friendly_name": "friendly_name",
19
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"origin": "origin",
21
"phone_number": "+15005550000",
22
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
23
"sms_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
24
"sms_fallback_method": "GET",
25
"sms_fallback_url": "https://example.com",
26
"sms_method": "GET",
27
"sms_url": "https://example.com",
28
"status_callback": "https://example.com",
29
"status_callback_method": "GET",
30
"trunk_sid": null,
31
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
32
"voice_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
"voice_caller_id_lookup": false,
34
"voice_fallback_method": "GET",
35
"voice_fallback_url": "https://example.com",
36
"voice_method": "GET",
37
"voice_url": "https://example.com",
38
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
"voice_receive_mode": "voice",
40
"status": "in-use"
41
}

Example 3: Attempt to buy an invalid number

test-post-example-3 page anchor

Specify an invalid number as input. Very short or very long strings fail validation.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createIncomingPhoneNumber() {
11
const incomingPhoneNumber = await client.incomingPhoneNumbers.create({
12
phoneNumber: "33",
13
});
14
15
console.log(incomingPhoneNumber.accountSid);
16
}
17
18
createIncomingPhoneNumber();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"address_requirements": "none",
4
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"api_version": "2010-04-01",
6
"beta": false,
7
"capabilities": {
8
"voice": true,
9
"sms": false,
10
"mms": true,
11
"fax": false
12
},
13
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
14
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
15
"emergency_status": "Active",
16
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"emergency_address_status": "registered",
18
"friendly_name": "friendly_name",
19
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"origin": "origin",
21
"phone_number": "33",
22
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
23
"sms_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
24
"sms_fallback_method": "GET",
25
"sms_fallback_url": "https://example.com",
26
"sms_method": "GET",
27
"sms_url": "https://example.com",
28
"status_callback": "https://example.com",
29
"status_callback_method": "GET",
30
"trunk_sid": null,
31
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
32
"voice_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
"voice_caller_id_lookup": false,
34
"voice_fallback_method": "GET",
35
"voice_fallback_url": "https://example.com",
36
"voice_method": "GET",
37
"voice_url": "https://example.com",
38
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
"voice_receive_mode": "voice",
40
"status": "in-use"
41
}

You can test the Messages API without sending an SMS or incurring charges by using your test credentials.

Send a POST request to the standard SMS endpoint, authenticating with your test credentials and using your TestAccountSid in the URL:

POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Messages

All standard outbound SMS parameters work, except for MessagingServiceSid. The following magic input values generate success and failure cases.

Your test credentials don't have access to verified From phone numbers in your live account. Use the following magic numbers:

ValueDescriptionError code
+15005550001Phone number is invalid.21212
+15005550007Number is not owned by your account or is not SMS-capable.21606
+15005550008SMS message queue for this number is full.21611
+15005550006Number passes all validation.No error
All othersNumber is not owned by your account or is not SMS-capable.21606
ValueDescriptionError code
+15005550001Phone number is invalid.21211
+15005550002Twilio can't route to this number.21612
+15005550003Account lacks international permissions to send SMS to this number.21408
+15005550004Number is blocked for your account.21610
+15005550009Number can't receive SMS messages.21614
All othersNumber is validated normally.Input-dependent

Send an SMS successfully by using the magic number +15005550006 as the From number and any valid phone number as the To number.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
body: "All in the game, yo",
13
from: "+15005550006",
14
to: "+5571981265131",
15
});
16
17
console.log(message.body);
18
}
19
20
createMessage();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"api_version": "2010-04-01",
4
"body": "All in the game, yo",
5
"date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
6
"date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
7
"date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
8
"direction": "outbound-api",
9
"error_code": null,
10
"error_message": null,
11
"from": "+15005550006",
12
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"num_media": "0",
14
"num_segments": "1",
15
"price": null,
16
"price_unit": null,
17
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
18
"status": "queued",
19
"subresource_uris": {
20
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
21
},
22
"to": "+5571981265131",
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
24
}

Attempt to send a message to a non-mobile number by passing the magic number +15005550009 as the To number.

Attempt to send a message to a non-mobile numberLink to code sample: Attempt to send a message to a non-mobile number
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
body: "Hey Mr Nugget, you the bomb!",
13
from: "+15005550006",
14
to: "+15005550009",
15
});
16
17
console.log(message.body);
18
}
19
20
createMessage();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"api_version": "2010-04-01",
4
"body": "Hey Mr Nugget, you the bomb!",
5
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
6
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
7
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
8
"direction": "outbound-api",
9
"error_code": null,
10
"error_message": null,
11
"from": "+15005550006",
12
"num_media": "0",
13
"num_segments": "1",
14
"price": null,
15
"price_unit": null,
16
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
18
"status": "queued",
19
"subresource_uris": {
20
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
21
},
22
"to": "+15005550009",
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
24
}

Attempt to send a message with an empty SMS body. No magic numbers are required; the validation error is raised normally.

Attempt to send a message with an empty SMS bodyLink to code sample: Attempt to send a message with an empty SMS body
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessage() {
11
const message = await client.messages.create({
12
body: "",
13
from: "+15005550006",
14
to: "+14108675310",
15
});
16
17
console.log(message.body);
18
}
19
20
createMessage();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"api_version": "2010-04-01",
4
"body": "",
5
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
6
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
7
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
8
"direction": "outbound-api",
9
"error_code": null,
10
"error_message": null,
11
"from": "+15005550006",
12
"num_media": "0",
13
"num_segments": "1",
14
"price": null,
15
"price_unit": null,
16
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
18
"status": "queued",
19
"subresource_uris": {
20
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
21
},
22
"to": "+14108675310",
23
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
24
}

Test making a call

test-calls page anchor

You can test the Calls API without placing a real call or incurring charges by using your test credentials. Because no call is placed, Twilio doesn't request the URL specified in the Url parameter and no TwiML is executed.

Send a POST request to the standard outbound call endpoint, authenticating with your test credentials and using your TestAccountSid in the URL:

POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Calls

All standard outbound call parameters work. The following magic input values generate success and failure cases.

Use the following magic numbers as the From phone number:

ValueDescriptionError code
+15005550001Phone number is invalid.21212
+15005550006Valid From number for your account.No error
All othersNumber isn't verified for your account.21210
ValueDescriptionError code
+15005550001Phone number is invalid.21217
+15005550002Twilio can't route to this number.21214
+15005550003Account lacks international permissions to call this number.21215
+15005550004Number is blocked for your account.21216
All othersNumber is validated normally.Input-dependent

Enqueue an outgoing call successfully by using the magic number +15005550006 as the From number and any valid phone number as the To number.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createCall() {
11
const call = await client.calls.create({
12
from: "+15005550006",
13
to: "+14108675310",
14
url: "http://demo.twilio.com/docs/voice.xml",
15
});
16
17
console.log(call.sid);
18
}
19
20
createCall();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"answered_by": null,
4
"api_version": "2010-04-01",
5
"caller_name": null,
6
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
7
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
8
"direction": "inbound",
9
"duration": "15",
10
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
11
"forwarded_from": "+141586753093",
12
"from": "+15005550006",
13
"from_formatted": "(415) 867-5308",
14
"group_sid": null,
15
"parent_call_sid": null,
16
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"price": "-0.03000",
18
"price_unit": "USD",
19
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
21
"status": "completed",
22
"subresource_uris": {
23
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
24
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
25
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
26
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
27
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
28
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
29
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
30
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",
31
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"
32
},
33
"to": "+14108675310",
34
"to_formatted": "(415) 867-5309",
35
"trunk_sid": null,
36
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
37
"queue_time": "1000"
38
}

Attempt to call an international number in a country without permissions enabled by passing the magic number +15005550003 as the To number.

Making a call to an international number in a country without permissions turned onLink to code sample: Making a call to an international number in a country without permissions turned on
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createCall() {
11
const call = await client.calls.create({
12
from: "+15005550006",
13
to: "+15005550003",
14
url: "http://demo.twilio.com/docs/voice.xml",
15
});
16
17
console.log(call.sid);
18
}
19
20
createCall();

Response

Note about this response
1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"answered_by": null,
4
"api_version": "2010-04-01",
5
"caller_name": null,
6
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
7
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
8
"direction": "inbound",
9
"duration": "15",
10
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
11
"forwarded_from": "+141586753093",
12
"from": "+15005550006",
13
"from_formatted": "(415) 867-5308",
14
"group_sid": null,
15
"parent_call_sid": null,
16
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"price": "-0.03000",
18
"price_unit": "USD",
19
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
21
"status": "completed",
22
"subresource_uris": {
23
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
24
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
25
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
26
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
27
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
28
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
29
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
30
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",
31
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"
32
},
33
"to": "+15005550003",
34
"to_formatted": "(415) 867-5309",
35
"trunk_sid": null,
36
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
37
"queue_time": "1000"
38
}

For details on testing Lookup with test credentials, see Magic Numbers for Lookup(link takes you to an external page).