Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

REST API: Subaccounts


Subaccounts in Twilio are accounts that are "owned" by your main account. Using a subaccount, you can segment each of your customers' use of Twilio and keep it separate from all the rest. This will allow you to easily manage the activity and resources of each customer independently.

(warning)

Warning

Important Notes:


Billing

billing page anchor

Twilio bills all subaccount usage directly to your main account. You'll have one Twilio balance for all subaccounts. If your main Twilio account is ever suspended, your subaccounts will also be suspended.

Skip to calculate billing for subaccounts >>


You can use your main account credentials (AccountSid and AuthToken) to access Twilio's REST API for your main account, as well as v2010 API resources for any of your subaccounts. You may also use a subaccount's AccountSid and AuthToken to access the resources of that subaccount. You can not use a subaccount's credentials to access the resources of your main Twilio account or any other subaccounts.

If you're authenticating the helper libraries, pass in your main Account SID and main Auth Token as the first two credentials, and the appropriate Subaccount SID as the third parameter.

(error)

Danger

When performing CRUD operations within a subaccount, use the subaccount SID and auth token. Alternatively, you can generate API Keys at the subaccount level for authentication.

(warning)

Warning

Main account API Keys are only available to access main account resources. Access to subaccount resources will be denied.

(warning)

Warning

Your main account credentials will allow you to access resources for any of your subaccounts that fall under the v2010 REST API. However, resources on subdomains, such as studio.twilio.com and taskrouter.twilio.com, must be accessed directly using subaccount credentials (API Keys or subaccount SID + subaccount auth token).

There are many ways to determine if a resource lives on its own subdomain or under v2010. One example method is to find the API Reference page for the resource, such as the Workspace resource. Observe the returned URL value in the example payloads: if the URL begins with https://SOME-SUBDOMAIN.twilio.com, then you must access that resource using subaccount-specific credentials. If you do the same for some other resource, such as the Messaging resource, and see that URI begins with /2010-04-01, then it can be safely accessed using either your main account or subaccount credentials.


We are currently working on ways to help our customers minimize the risk of fraudulent international calls and provide ways for Twilio subaccounts to dial certain international destinations. If you have any questions, please contact support.


Subaccounts use the main account's voice and SMS messaging permissions.


To create a new subaccount, make an HTTP POST request to your Accounts list resource URI:


_10
/2010-04-01/Accounts

If successful, Twilio responds with a representation of the new Account resource.

POST Parameters

creating-subaccounts-post-parameters page anchor

Optional Parameters

creating-subaccounts-post-parameters-optional page anchor

Your request to create a subaccount may include the following parameters:

Request body parameters
FriendlyNametype: stringPII MTL: 30 days

A human readable description of the account to create, defaults to SubAccount Created at {YYYY-MM-DD HH:MM meridian}

The FriendlyName property is useful for organizing accounts and linking them back to information in your system. For example, you may want to create subaccounts where the FriendlyName is the primary key of the customer in your application's database.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts
_10
.create({friendlyName: 'Submarine'})
_10
.then(account => console.log(account.sid));

Output

_33
{
_33
"auth_token": "auth_token",
_33
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"friendly_name": "Submarine",
_33
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"status": "active",
_33
"subresource_uris": {
_33
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_33
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_33
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_33
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_33
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_33
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_33
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_33
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_33
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_33
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_33
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_33
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_33
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_33
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_33
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_33
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_33
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_33
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_33
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_33
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_33
},
_33
"type": "Full",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_33
}


Getting Started with Subaccounts

getting-started-with-subaccounts page anchor

Subaccounts are a great way to segment your Twilio usage and act on behalf of your customers, agents or employees.

If you are running a hosted service that relies on Twilio you can create a Twilio subaccount for each customer that signs up. Then if a customer closes his or her account with your service, you can simply deactivate the associated Twilio subaccount.

Subaccounts allow you to use the Twilio REST API just as you would for a single account; a subaccount can have its phone numbers and caller IDs, applications and SIP Domains. You can manage a subaccount's calls, messages, recordings, and transcriptions without affecting other subaccounts.


You can query any particular subaccount and its related resources via the REST API by AccountSid.

Return a subaccount resource by its account SID

return-a-subaccount-resource-by-its-account-sid page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(account => console.log(account.friendlyName));

Output

_33
{
_33
"auth_token": "auth_token",
_33
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"friendly_name": "friendly_name",
_33
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"status": "active",
_33
"subresource_uris": {
_33
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_33
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_33
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_33
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_33
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_33
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_33
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_33
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_33
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_33
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_33
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_33
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_33
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_33
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_33
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_33
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_33
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_33
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_33
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_33
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_33
},
_33
"type": "Full",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_33
}

If you don't know the AccountSid of a subaccount but you know the FriendlyName, you can query your Accounts list resource with a FriendlyName query string filter:

Query subaccounts by friendly name

query-subaccounts-by-friendly-name page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts
_10
.list({friendlyName: 'MySubaccount', limit: 20})
_10
.then(accounts => accounts.forEach(a => console.log(a.sid)));

Output

_11
{
_11
"first_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_11
"end": 0,
_11
"previous_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_11
"accounts": [],
_11
"uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_11
"page_size": 50,
_11
"start": 0,
_11
"next_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=50",
_11
"page": 0
_11
}


Making a phone call with a Subaccount

call-subaccounts page anchor

To make calls using a subaccount, use the subaccount's Account SID and Auth Token, as shown in lines 7 and 8 of the following code sample:

Make a call from a subaccount

make-a-call-from-a-subaccount page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const subaccountSid = process.env.TWILIO_SUBACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken, { accountSid: subaccountSid });
_15
_15
client.calls
_15
.create({
_15
url: 'http://twimlets.com/message?Message%5B0%5D=Hello%20from%20your%20subaccount',
_15
to: '+16518675310',
_15
from: '+14158141829'
_15
})
_15
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+14158141829",
_37
"from_formatted": "(415) 814-1829",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+16518675310",
_37
"to_formatted": "(651) 867-5310",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}


Sending a message from a Subaccount

sending-a-message-from-a-subaccount page anchor

In order to send messages using a subaccount, use the subaccount's Account SID and Auth Token when making your request to Twilio's Programmable Messaging API.

Send a message from a subaccount

send-a--message-from-a-subaccount page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const subaccountSid = process.env.TWILIO_SUBACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken, { accountSid: subaccountSid });
_11
_11
client.messages
_11
.create({from: '+14158141829', body: 'Ahoy there!', to: '+16518675310'})
_11
.then(message => console.log(message.sid));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"api_version": "2010-04-01",
_24
"body": "Ahoy there!",
_24
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"direction": "outbound-api",
_24
"error_code": null,
_24
"error_message": null,
_24
"from": "+14158141829",
_24
"num_media": "0",
_24
"num_segments": "1",
_24
"price": null,
_24
"price_unit": null,
_24
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "queued",
_24
"subresource_uris": {
_24
"media": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json"
_24
},
_24
"to": "+16518675310",
_24
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_24
}


Calculate billing for Subaccount usage

billing-subaccounts page anchor

In many cases, you may want to calculate the billing incurred by a subaccount. Let's say you created a subaccount for a customer and you needed to charge them for their usage.

You can iterate over all of the calls and sum up the product of price and duration.

The example below shows the API request to fetch all Calls that began on January 15, 2018. In the response, each object in the calls array contains a price property.

Note: In this example, the StartTime parameter returns calls only that began on January 15, 2018. You can also use inequalities (e.g. <= and >=) and the EndTime parameter to fetch all Calls from a specific date span. Learn more on the Call Resource API Reference page.

Calculate billing for subaccount usage

calculate-billing-for-subaccount-usage page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const subaccountSid = process.env.TWILIO_SUBACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken, { accountSid: subaccountSid });
_11
_11
client.calls
_11
.list({startTime: new Date(Date.UTC(2018, 0, 15, 0, 0, 0)), limit: 20})
_11
.then(calls => calls.forEach(c => console.log(c.price)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}


Suspending a Subaccount

suspending-subaccounts page anchor

While an account is suspended it cannot make or receive phone calls or send and receive SMS messages. This is useful when your customer does not pay their bill and you want to suspend their account until a successful payment is received. However, you will be charged monthly for any phone numbers the subaccount owns.

To suspend a subaccount, POST the parameter 'Status' with the value 'suspended' to suspend an account.

(warning)

Warning

Note that in-progress calls will not automatically end when a subaccount is suspended. This must be done manually by changing the status of these calls to completed.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts('ACXXXX-SUBACCOUNT-SID-XXXX')
_10
.update({status: 'suspended'})
_10
.then(account => console.log(account.sid));

Output

_33
{
_33
"auth_token": "auth_token",
_33
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"friendly_name": "friendly_name",
_33
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"status": "suspended",
_33
"subresource_uris": {
_33
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_33
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_33
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_33
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_33
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_33
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_33
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_33
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_33
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_33
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_33
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_33
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_33
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_33
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_33
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_33
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_33
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_33
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_33
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_33
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_33
},
_33
"type": "Full",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_33
}

To reactivate a suspended subaccount, POST the value active for the Status parameter and we will restore the account to full service.

Re-activate a Suspended Subaccount

re-activate-a-suspended-subaccount page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts('ACXXXX-SUBACCOUNT-SID-XXXX')
_10
.update({status: 'active'})
_10
.then(account => console.log(account.friendlyName));

Output

_33
{
_33
"auth_token": "auth_token",
_33
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"friendly_name": "friendly_name",
_33
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"status": "active",
_33
"subresource_uris": {
_33
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_33
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_33
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_33
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_33
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_33
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_33
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_33
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_33
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_33
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_33
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_33
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_33
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_33
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_33
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_33
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_33
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_33
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_33
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_33
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_33
},
_33
"type": "Full",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_33
}

(warning)

Warning

Note that you must use your main account's authentication credentials to suspend a subaccount. You cannot suspend your main account.


If your customer closes their account with you, you can permanently close the associated Twilio subaccount by POSTing the parameter Status with the value closed to the subaccount resource URI.

Permanently Close a Subaccount

permanently-close-a-subaccount page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts('ACXXXX-SUBACCOUNT-SID-XXXX')
_10
.update({status: 'closed'})
_10
.then(account => console.log(account.friendlyName));

Output

_33
{
_33
"auth_token": "auth_token",
_33
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_33
"friendly_name": "friendly_name",
_33
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"status": "closed",
_33
"subresource_uris": {
_33
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_33
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_33
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_33
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_33
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_33
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_33
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_33
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_33
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_33
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_33
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_33
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_33
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_33
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_33
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_33
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_33
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_33
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_33
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_33
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_33
},
_33
"type": "Full",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_33
}

When you close a subaccount, Twilio will release all phone numbers assigned to it and shut it down completely. You can't ever use a closed account to make and receive phone calls or send and receive SMS messages. It's closed, gone, kaput - you cannot reopen a closed account.

Your closed subaccount will still appear in your accounts list, and you will still have access to historical data for that subaccount, unless automatic deletion of closed subaccounts is enabled.

If you have enabled automatic deletion of closed subaccounts through the Subaccounts(link takes you to an external page) settings page, we will delete all subaccount data 30 days after closure including previously closed subaccounts and those subaccounts will no longer appear on the Console.

  • Twilio has enabled this setting for all accounts created after July 5, 2018, and for all accounts without subaccounts
  • For all other accounts, account owners can turn this setting on through the Subaccounts(link takes you to an external page) settings page.
(warning)

Warning

Note that you must use your main account's authentication credentials to close a subaccount. You also cannot close your main account.


Exchanging Phone Numbers Between Accounts

exchanging-numbers page anchor

You can transfer numbers between subaccounts, and between your main account and any one of your subaccounts. You must use your main account's credentials when making the API request to transfer a phone number.

To transfer a phone number between two accounts that you control, make an HTTP POST request to an IncomingPhoneNumber instance resource URI. In the body of the POST set the parameter 'AccountSid' to the AccountSid of the account you wish to own that number. This will remove the phone number from its original account and make it available under the IncomingPhoneNumbers list resource of the new account while retaining all other properties.

If any of the phone numbers you would like to transfer have Address Requirements, you will need to create a compliant Address in the new subaccount before transferring the phone number.

Remember, closing a subaccount as described above will release all of that account's phone numbers, so you might consider transferring all numbers to your main account beforehand if you want to keep them.

Transfer a phone number from your primary account AC00000000000000000000000000000001 to subaccount AC00000000000000000000000000000002:

Transfer phone numbers from primary account to subaccount

transfer-phone-numbers-from-primary-account-to-subaccount page anchor
Node.js
Python
C#
Java
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Your Account Sid and Auth Token from twilio.com/console
_10
// To set up environmental variables, see http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({accountSid: process.env.TWILIO_SUB_ACCOUNT_SID})
_10
.then(incoming_phone_number => console.log(incoming_phone_number.friendlyName));

Output

_36
{
_36
"account_sid": "AC00000000000000000000000000000002",
_36
"address_requirements": "none",
_36
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"api_version": "2010-04-01",
_36
"beta": false,
_36
"capabilities": {
_36
"mms": true,
_36
"sms": false,
_36
"voice": true
_36
},
_36
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_36
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_36
"emergency_status": "Inactive",
_36
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"friendly_name": "My Company Line",
_36
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"origin": "origin",
_36
"phone_number": "+15105647903",
_36
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"sms_application_sid": null,
_36
"sms_fallback_method": "POST",
_36
"sms_fallback_url": "",
_36
"sms_method": "POST",
_36
"sms_url": "",
_36
"status_callback": "",
_36
"status_callback_method": "POST",
_36
"trunk_sid": null,
_36
"uri": "/2010-04-01/Accounts/AC00000000000000000000000000000002/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_36
"voice_application_sid": null,
_36
"voice_caller_id_lookup": false,
_36
"voice_fallback_method": "POST",
_36
"voice_fallback_url": null,
_36
"voice_method": "POST",
_36
"voice_url": null
_36
}


Rate this page: