REST API: Accounts

When you first sign up with Twilio, you have just one account, your Master account. But you can also create more accounts... subaccounts are useful for things like segmenting phone numbers and usage data for your customers and controlling access to data. For more information on subaccounts see Using Subaccounts.

Account Instance Resource

An Account instance resource represents a single Twilio account.

Resource URI

/2010-04-01/Accounts/{AccountSid}

Resource Properties

An Account resource is represented by the following properties:

Property Description
Sid A 34 character string that uniquely identifies this account.
DateCreated The date that this account was created, in GMT in RFC 2822 format
DateUpdated The date that this account was last updated, in GMT in RFC 2822 format.
FriendlyName A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address.
Type The type of this account. Either Trial or Full if you've upgraded.
Status The status of this account. Usually active, but can be suspended if you've been bad, or closed if you've been horrible.
AuthToken The authorization token for this account. This token should be kept a secret, so no sharing.
Uri The URI for this resource, relative to https://api.twilio.com.
SubresourceUris The list of subresources under this account.

HTTP GET

Returns a representation of an account, including the properties above.

Example
Try it now
  • GET /2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d

    <TwilioResponse>
      <Account>
        <Sid>ACba8bc05eacf94afdae398e642c9cc32d</Sid>
        <FriendlyName>Do you like my friendly name?</FriendlyName>
        <Type>Full</Type>
        <Status>active</Status>
        <DateCreated>Wed, 04 Aug 2010 21:37:41 +0000</DateCreated>
        <DateUpdated>Fri, 06 Aug 2010 01:15:02 +0000</DateUpdated>
        <AuthToken>redacted</AuthToken>
        <Uri>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d</Uri>
        <SubresourceUris>
          <AvailablePhoneNumbers>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/AvailablePhoneNumbers</AvailablePhoneNumbers>
          <Calls>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Calls</Calls>
          <Conferences>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Conferences</Conferences>
          <IncomingPhoneNumbers>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/IncomingPhoneNumbers</IncomingPhoneNumbers>
          <Notifications>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Notifications</Notifications>
          <OutgoingCallerIds>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/OutgoingCallerIds</OutgoingCallerIds>
          <Recordings>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Recordings</Recordings>
          <Sandbox>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Sandbox</Sandbox>
          <SMSMessages>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/SMS/Messages</SMSMessages>
          <Transcriptions>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Transcriptions</Transcriptions>
        </SubresourceUris>
      </Account>
    </TwilioResponse>    

HTTP POST and PUT

Allows you to modify the properties of an account.

See the Subaccounts reference for more information on suspending, unsuspending or closing subaccounts using the 'Status' parameter.

Optional Parameters

You may POST the following parameters:

Property Description
FriendlyName Update the human-readable description of this account.
Status Alter the status of this account: use closed to irreversibly close this account, suspended to temporarily suspend it, or active to reactivate it.
Example 1

Suspend a subaccount by POSTing 'Status' = 'suspended':

Try it now
  • POST /2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c

    Status=suspended

    <TwilioResponse>
      <Account>
        <Sid>AC1365ff479ef6502d85c27be6467a310c</Sid>
        <FriendlyName>MySubaccount</FriendlyName>
        <Status>suspended</Status>
        <AuthToken>redacted</AuthToken>
        <DateCreated>Tue, 12 Jan 2010 04:41:09 +0000</DateCreated>
        <DateUpdated>Tue, 25 Jan 2011 07:24:36 +0000</DateUpdated>
        <Type>Full</Type>
        <Uri>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c</Uri>
        <SubresourceUris>
          <AvailablePhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/AvailablePhoneNumbers</AvailablePhoneNumbers>
          <Calls>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Calls</Calls>
          <Conferences>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Conferences</Conferences>
          <IncomingPhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/IncomingPhoneNumbers</IncomingPhoneNumbers>
          <Notifications>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Notifications</Notifications>
          <OutgoingCallerIds>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/OutgoingCallerIds</OutgoingCallerIds>
          <Recordings>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Recordings</Recordings>
          <Sandbox>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Sandbox</Sandbox>
          <SMSMessages>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/SMS/Messages</SMSMessages>
          <Transcriptions>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Transcriptions</Transcriptions>
        </SubresourceUris>
      </Account>
    </TwilioResponse>    
Example 2

Re-activate a subaccount that was previously suspended by POSTing 'Status' = 'active':

Try it now
  • POST /2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c

    Status=active

    <TwilioResponse>
      <Account>
        <Sid>AC1365ff479ef6502d85c27be6467a310c</Sid>
        <FriendlyName>MySubaccount</FriendlyName>
        <Status>active</Status>
        <AuthToken>redacted</AuthToken>
        <DateCreated>Tue, 12 Jan 2010 04:41:09 +0000</DateCreated>
        <DateUpdated>Tue, 25 Jan 2011 07:24:36 +0000</DateUpdated>
        <Type>Full</Type>
        <Uri>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c</Uri>
        <SubresourceUris>
          <AvailablePhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/AvailablePhoneNumbers</AvailablePhoneNumbers>
          <Calls>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Calls</Calls>
          <Conferences>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Conferences</Conferences>
          <IncomingPhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/IncomingPhoneNumbers</IncomingPhoneNumbers>
          <Notifications>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Notifications</Notifications>
          <OutgoingCallerIds>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/OutgoingCallerIds</OutgoingCallerIds>
          <Recordings>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Recordings</Recordings>
          <Sandbox>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Sandbox</Sandbox>
          <SMSMessages>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/SMS/Messages</SMSMessages>
          <Transcriptions>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Transcriptions</Transcriptions>
        </SubresourceUris>
      </Account>
    </TwilioResponse>    
Example 3

Permanently close a subaccount by POSTing 'Status' = 'closed':

Try it now
  • POST /2010-04-01/Accounts/AC12345678123456781234567812345678

    Status=closed

    <TwilioResponse>
      <Account>
        <Sid>AC12345678123456781234567812345678</Sid>
        <FriendlyName>MySubaccount</FriendlyName>
        <Status>closed</Status>
        <AuthToken>redacted</AuthToken>
        <DateCreated>Tue, 12 Jan 2010 04:41:09 +0000</DateCreated>
        <DateUpdated>Tue, 25 Jan 2011 07:24:36 +0000</DateUpdated>
        <Type>Full</Type>
        <Uri>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c</Uri>
        <SubresourceUris>
          <AvailablePhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/AvailablePhoneNumbers</AvailablePhoneNumbers>
          <Calls>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Calls</Calls>
          <Conferences>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Conferences</Conferences>
          <IncomingPhoneNumbers>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/IncomingPhoneNumbers</IncomingPhoneNumbers>
          <Notifications>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Notifications</Notifications>
          <OutgoingCallerIds>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/OutgoingCallerIds</OutgoingCallerIds>
          <Recordings>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Recordings</Recordings>
          <Sandbox>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Sandbox</Sandbox>
          <SMSMessages>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/SMS/Messages</SMSMessages>
          <Transcriptions>/2010-04-01/Accounts/AC1365ff479ef6502d85c27be6467a310c/Transcriptions</Transcriptions>
        </SubresourceUris>
      </Account>
    </TwilioResponse>    

HTTP DELETE

Not supported. You can't delete an account using the REST API.

Accounts List Resource

The Accounts list resource represents the set of Accounts belonging to the Account used to make the API request. This list includes that account, along with any subaccounts belonging to it.

You can use the Accounts list resource to create subaccounts and retrieve the subaccounts that exist under your main account. See Subaccounts for more information.

Resource URI

/2010-04-01/Accounts

HTTP GET

Retrieve a list of the Account resources belonging to the account used to make the API request. This list will include that Account as well.

List Filters

The following query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:

Parameter Description
FriendlyName Only return the Account resources with friendly names that exactly match this name.
Status Only return Account resources with the given status. Can be closed, suspended or active.
Example 1

List all accounts:

Try it now
  • GET /2010-04-01/Accounts

    <TwilioResponse>
      <Accounts page="0" numpages="1" pagesize="50" total="1" start="0" end="1" uri="/2010-04-01/Accounts" firstpageuri="/2010-04-01/Accounts?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="" lastpageuri="/2010-04-01/Accounts?Page=0&amp;PageSize=50">
        <Account>
          <Sid>AC39b8702b46fbbbf3f2956a63ee851a01</Sid>
          <FriendlyName>Chieftain</FriendlyName>
          <Status>active</Status>
          <AuthToken>redacted</AuthToken>
          <DateCreated>Tue, 12 Jan 2010 04:41:09 +0000</DateCreated>
          <DateUpdated>Tue, 25 Jan 2011 07:24:36 +0000</DateUpdated>
          <Type>Full</Type>
          <Uri>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01</Uri>
          <SubresourceUris>
            <AvailablePhoneNumbers>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/AvailablePhoneNumbers</AvailablePhoneNumbers>
            <Calls>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Calls</Calls>
            <Conferences>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Conferences</Conferences>
            <IncomingPhoneNumbers>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/IncomingPhoneNumbers</IncomingPhoneNumbers>
            <Notifications>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Notifications</Notifications>
            <OutgoingCallerIds>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/OutgoingCallerIds</OutgoingCallerIds>
            <Recordings>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Recordings</Recordings>
            <Sandbox>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Sandbox</Sandbox>
            <SMSMessages>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/SMS/Messages</SMSMessages>
            <Transcriptions>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Transcriptions</Transcriptions>
          </SubresourceUris>
        </Account>
      </Accounts>
    </TwilioResponse>    
Example 2

List all accounts that are currently 'active':

Try it now
  • GET /2010-04-01/Accounts?Status=active

    <TwilioResponse>
      <Accounts page="0" numpages="1" pagesize="50" total="2" start="0" end="1" uri="/2010-04-01/Accounts" firstpageuri="/2010-04-01/Accounts?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="" lastpageuri="/2010-04-01/Accounts?Page=0&amp;PageSize=50">
        <Account>
          <Sid>AC39b8702b46fbbbf3f2956a63ee851a01</Sid>
          <FriendlyName>Chieftain</FriendlyName>
          <Status>active</Status>
          <AuthToken>redacted</AuthToken>
          <DateCreated>Tue, 12 Jan 2010 04:41:09 +0000</DateCreated>
          <DateUpdated>Tue, 25 Jan 2011 07:24:36 +0000</DateUpdated>
          <Type>Full</Type>
          <Uri>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01</Uri>
          <SubresourceUris>
            <AvailablePhoneNumbers>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/AvailablePhoneNumbers</AvailablePhoneNumbers>
            <Calls>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Calls</Calls>
            <Conferences>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Conferences</Conferences>
            <IncomingPhoneNumbers>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/IncomingPhoneNumbers</IncomingPhoneNumbers>
            <Notifications>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Notifications</Notifications>
            <OutgoingCallerIds>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/OutgoingCallerIds</OutgoingCallerIds>
            <Recordings>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Recordings</Recordings>
            <Sandbox>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Sandbox</Sandbox>
            <SMSMessages>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/SMS/Messages</SMSMessages>
            <Transcriptions>/2010-04-01/Accounts/AC39b8702b46fbbbf3f2956a63ee851a01/Transcriptions</Transcriptions>
          </SubresourceUris>
        </Account>
        <Account>
          <Sid>AC755325d45d80675b4727a7a54e1b4ce2</Sid>
          <FriendlyName>Chieftain Subaccount</FriendlyName>
          <Status>active</Status>
          <AuthToken>redacted</AuthToken>
          <DateCreated>Tue, 16 Jan 2010 04:41:09 +0000</DateCreated>
          <DateUpdated>Tue, 17 Jan 2011 07:24:36 +0000</DateUpdated>
          <Type>Full</Type>
          <Uri>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4</Uri>
          <SubresourceUris>
            <AvailablePhoneNumbers>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/AvailablePhoneNumbers</AvailablePhoneNumbers>
            <Calls>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Calls</Calls>
            <Conferences>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Conferences</Conferences>
            <IncomingPhoneNumbers>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/IncomingPhoneNumbers</IncomingPhoneNumbers>
            <Notifications>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Notifications</Notifications>
            <OutgoingCallerIds>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/OutgoingCallerIds</OutgoingCallerIds>
            <Recordings>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Recordings</Recordings>
            <Sandbox>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Sandbox</Sandbox>
            <SMSMessages>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/SMS/Messages</SMSMessages>
            <Transcriptions>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/Transcriptions</Transcriptions>
          </SubresourceUris>
        </Account>
      </Accounts>
    </TwilioResponse>    

HTTP POST

Create a new Account instance resource as a subaccount of the one used to make the request. See Creating Subaccounts for more information.

HTTP PUT

Not supported

HTTP DELETE

Not Supported

Helper Libraries for Java, Python, C#, Ruby, and PHP

This page explains the format for raw HTTP calls to the Twilio API. We also have helper libraries in a number of popular programming languages, which make it easy for you to get started with Twilio.