Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

REST API: Applications

An Application instance resource represents an application that you have created with Twilio. An application inside of Twilio is just a set of URLs and other configuration data that tells Twilio how to behave when one of your Twilio numbers receives a call or SMS message. This configuration data is the same configuration data that exists on IncomingPhoneNumber resources: 'VoiceUrl', 'VoiceMethod', 'VoiceFallbackUrl', 'VoiceFallbackMethod', 'StatusCallback', 'StatusCallbackMethod', 'VoiceCallerIdLookup', 'SmsUrl', 'SmsMethod', 'SmsFallbackUrl', 'SmsFallbackMethod', and 'SmsStatusCallback'.

The Applications list resource represents the set of an account's Twilio applications. You can POST to the list resource to create a new application. Note that accounts can contain at most 1000 applications.

Applications are useful for encapsulating configuration information that you need to distribute across multiple phone numbers. You can assign an ApplicationSid to an IncomingPhoneNumber to tell Twilio to use the application's URLs instead of the ones set directly on the IncomingPhoneNumber. So if you create an application with its VoiceUrl set to http://myapp.com/answer, you can assign that application to all of your phone numbers and Twilio will make a request to that URL whenever a call comes in.

Application properties

account_sid
sid<AC> Not PII

The unique id of the Account that created this application.

api_version
string Not PII

Requests to this application will start a new TwiML session with this API version.

date_created
date_time<rfc2822> Not PII

The date that this resource was created, given as GMT RFC 2822 format.

date_updated
date_time<rfc2822> Not PII

The date that this resource was last updated, given as GMT RFC 2822 format.

friendly_name
string Not PII

A human readable descriptive text for this resource, up to 64 characters long.

message_status_callback
url Not PII

Twilio will make a POST request to this URL to pass status parameters (such as sent or failed) to your application if you use the /Messages endpoint to send the message and specify this application's Sid as the ApplicationSid on an outgoing SMS request.

sid
sid<AP> Not PII

A 34 character string that uniquely identifies this resource.

sms_fallback_method
http_method Not PII

The HTTP method Twilio will use when requesting the above URL. Either GET or POST.

sms_fallback_url
url Not PII

The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.

sms_method
http_method Not PII

The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.

sms_status_callback
url Not PII

The URL that Twilio will POST to when a message is sent via the /SMS/Messages endpoint if you specify the Sid of this application on an outgoing SMS request.

sms_url
url Not PII

The URL Twilio will request when a phone number assigned to this application receives an incoming SMS message.

status_callback
url Not PII

The URL that Twilio will request to pass status parameters (such as call ended) to your application.

status_callback_method
http_method Not PII

The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.

uri
uri Not PII

The URI for this resource, relative to https://api.twilio.com.

voice_caller_id_lookup
boolean Not PII

Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either true or false.

voice_fallback_method
http_method Not PII

The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.

voice_fallback_url
url Not PII

The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.

voice_method
http_method Not PII

The HTTP method Twilio will use when requesting the above Url. Either GET or POST.

voice_url
url Not PII

The URL Twilio will request when a phone number assigned to this application receives a call.

Create an Application resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json

Creates a new application within your account.

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

Parameters
FriendlyName
Required
post string Not PII

A human readable description of the new application, maximum of 64 characters.

ApiVersion
Optional
post string Not PII

Requests to this application's URLs will start a new TwiML session with this API version. Either 2010-04-01 or 2008-08-01. Defaults to your account's default API version.

MessageStatusCallback
Optional
post url Not PII

Twilio will make a POST request to this URL to pass status parameters (such as sent or failed) to your application if you use the /Messages endpoint to send the message and specify this application's Sid as the ApplicationSid on an outgoing SMS request.

SmsFallbackMethod
Optional
post http_method Not PII

The HTTP method that should be used to request the SmsFallbackUrl. Must be either GET or POST. Defaults to POST.

SmsFallbackUrl
Optional
post url Not PII

A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl.

SmsMethod
Optional
post http_method Not PII

The HTTP method that should be used to request the SmsUrl. Must be either GET or POST. Defaults to POST.

SmsStatusCallback
Optional
post url Not PII

Twilio will make a POST request to this URL to pass status parameters (such as sent or failed) to your application if you specify this application's Sid as the ApplicationSid on an outgoing SMS request.

SmsUrl
Optional
post url Not PII

The URL Twilio will request when a phone number assigned to this application receives an incoming SMS message.

StatusCallback
Optional
post url Not PII

The URL that Twilio will request to pass status parameters (such as call ended) to your application.

StatusCallbackMethod
Optional
post http_method Not PII

The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. Defaults to POST.

VoiceCallerIdLookup
Optional
post boolean Not PII

Do a lookup of a caller's name from the CNAM database and post it to your app. Either true or false. Defaults to false.

VoiceFallbackMethod
Optional
post http_method Not PII

The HTTP method that should be used to request the VoiceFallbackUrl. Either GET or POST. Defaults to POST.

VoiceFallbackUrl
Optional
post url Not PII

The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.

VoiceMethod
Optional
post http_method Not PII

The HTTP method that should be used to request the VoiceUrl. Must be either GET or POST. Defaults to POST.

VoiceUrl
Optional
post url Not PII

The URL that Twilio should request when somebody dials a phone number assigned to this application.

Example 1
Loading Code Sample...
      
      
      
      

      Fetch an Application resource

      get
      https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
      Parameters
      Sid
      Required
      get sid<AP> Not PII

      The application Sid that that uniquely identifies this resource

      Example 1
      Loading Code Sample...
          
          
          
          

          Read multiple Application resources

          get
          https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json

          Returns a list of Application resource representations, each representing an application within your account. The list includes paging information.

          Parameters
          FriendlyName
          Optional
          get string Not PII

          Only return application resources with friendly names that match exactly with this name

          Example 1
          Loading Code Sample...
              
              
              
              
              Example 2
              Loading Code Sample...
                  
                  
                  
                  

                  Update an Application resource

                  post
                  https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json

                  Tries to update the application's properties, and returns the updated resource representation if successful. The returned response is identical to that returned above when making a GET request.

                  Parameters
                  ApiVersion
                  Optional
                  post string Not PII

                  Requests to this application's URLs will start a new TwiML session with this API version. Either 2010-04-01 or 2008-08-01.

                  FriendlyName
                  Optional
                  post string Not PII

                  A human readable description of the application, with maximum length 64 characters.

                  MessageStatusCallback
                  Optional
                  post url Not PII

                  Twilio will make a POST request to this URL to pass status parameters (such as sent or failed) to your application if you use the /Messages endpoint to send the message and specify this application's Sid as the ApplicationSid on an outgoing SMS request.

                  SmsFallbackMethod
                  Optional
                  post http_method Not PII

                  The HTTP method that should be used to request the SmsFallbackUrl. Either GET or POST.

                  SmsFallbackUrl
                  Optional
                  post url Not PII

                  A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl.

                  SmsMethod
                  Optional
                  post http_method Not PII

                  The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.

                  SmsStatusCallback
                  Optional
                  post url Not PII

                  The URL that Twilio will POST to when a message is sent via the /SMS/Messages endpoint if you specify the Sid of this application on an outgoing SMS request.

                  SmsUrl
                  Optional
                  post url Not PII

                  The URL Twilio will request when a phone number assigned to this application receives an incoming SMS message.

                  StatusCallback
                  Optional
                  post url Not PII

                  The URL that Twilio will request to pass status parameters (such as call ended) to your application.

                  StatusCallbackMethod
                  Optional
                  post http_method Not PII

                  The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.

                  VoiceCallerIdLookup
                  Optional
                  post boolean Not PII

                  Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either true or false.

                  VoiceFallbackMethod
                  Optional
                  post http_method Not PII

                  The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.

                  VoiceFallbackUrl
                  Optional
                  post url Not PII

                  A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by VoiceUrl.

                  VoiceMethod
                  Optional
                  post http_method Not PII

                  The HTTP method Twilio will use when requesting the above Url. Either GET or POST.

                  VoiceUrl
                  Optional
                  post url Not PII

                  The URL that Twilio should request when somebody dials a phone number assigned to this application.

                  Example 1
                  Loading Code Sample...
                      
                      
                      
                      

                      Delete an Application resource

                      delete
                      https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json

                      Delete this application. If this application's sid is assigned to any IncomingPhoneNumber resources as a VoiceApplicationSid or SmsApplicationSid it will be removed.

                      If successful, Twilio will return an HTTP 204 response with no body.

                      Parameters
                      Sid
                      Required
                      delete sid<AP> Not PII

                      The application sid the uniquely identifies this application

                      Example 1
                      Loading Code Sample...
                          
                          
                          
                          

                          Need some help?

                          We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

                          Loading Code Sample...