Menu

Expand
Rate this page:

REST API: Applications

An Application Resource (also referred to as a "TwiML Application" or "TwiML App") represents a collection of endpoints that return TwiML instructions to Twilio. TwiML Applications are most commonly used for the Voice SDKs to handle outbound calls, but can also be used to configure multiple phone numbers with the same set of TwiML endpoints.

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

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the Application resource.

api_version
string Not PII

The API version used to start a new TwiML session.

date_created
date_time<rfc2822> Not PII

The date and time in GMT that the resource was created specified in RFC 2822 format.

date_updated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was last updated specified in RFC 2822 format.

friendly_name
string Not PII

The string that you assigned to describe the resource.

message_status_callback
url Not PII

The URL we call using a POST method to send message status information to your application.

sid
sid<AP> Not PII

The unique string that that we created to identify the Application resource.

sms_fallback_method
http_method Not PII

The HTTP method we use to call sms_fallback_url. Can be: GET or POST.

sms_fallback_url
url Not PII

The URL that we call when an error occurs while retrieving or executing the TwiML from sms_url.

sms_method
http_method Not PII

The HTTP method we use to call sms_url. Can be: GET or POST.

sms_status_callback
url Not PII

The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.

sms_url
url Not PII

The URL we call when the phone number receives an incoming SMS message.

status_callback
url Not PII

The URL we call using the status_callback_method to send status information to your application.

status_callback_method
http_method Not PII

The HTTP method we use to call status_callback. Can be: GET or POST.

uri
uri Not PII

The URI of the resource, relative to https://api.twilio.com.

voice_caller_id_lookup
boolean Not PII

Whether we look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true or false.

voice_fallback_method
http_method Not PII

The HTTP method we use to call voice_fallback_url. Can be: GET or POST.

voice_fallback_url
url Not PII

The URL that we call when an error occurs retrieving or executing the TwiML requested by url.

voice_method
http_method Not PII

The HTTP method we use to call voice_url. Can be: GET or POST.

voice_url
url Not PII

The URL we call when the phone number assigned to this application receives a call.

public_application_connect_enabled
boolean Not PII

Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true or false.

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
Parameters in REST API format
account_sid
Path
post sid<AC> Not PII

The SID of the Account that will create the resource.

api_version
Optional
post string Not PII

The API version to use to start a new TwiML session. Can be: 2010-04-01 or 2008-08-01. The default value is the account's default API version.

voice_url
Optional
post url Not PII

The URL we should call when the phone number assigned to this application receives a call.

voice_method
Optional
post http_method Not PII

The HTTP method we should use to call voice_url. Can be: GET or POST.

voice_fallback_url
Optional
post url Not PII

The URL that we should call when an error occurs retrieving or executing the TwiML requested by url.

voice_fallback_method
Optional
post http_method Not PII

The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

status_callback
Optional
post url Not PII

The URL we should call using the status_callback_method to send status information to your application.

status_callback_method
Optional
post http_method Not PII

The HTTP method we should use to call status_callback. Can be: GET or POST.

voice_caller_id_lookup
Optional
post boolean Not PII

Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true or false.

sms_url
Optional
post url Not PII

The URL we should call when the phone number receives an incoming SMS message.

sms_method
Optional
post http_method Not PII

The HTTP method we should use to call sms_url. Can be: GET or POST.

sms_fallback_url
Optional
post url Not PII

The URL that we should call when an error occurs while retrieving or executing the TwiML from sms_url.

sms_fallback_method
Optional
post http_method Not PII

The HTTP method we should use to call sms_fallback_url. Can be: GET or POST.

sms_status_callback
Optional
post url Not PII

The URL we should call using a POST method to send status information about SMS messages sent by the application.

message_status_callback
Optional
post url Not PII

The URL we should call using a POST method to send message status information to your application.

friendly_name
Optional
post string Not PII

A descriptive string that you create to describe the new application. It can be up to 64 characters long.

public_application_connect_enabled
Optional
post boolean Not PII

Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true or false.

Example 1
Loading Code Sample...
        
        

        Create a New Application Within Your Account

        Fetch an Application resource

        get
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
        Parameters
        Parameters in REST API format
        account_sid
        Path
        get sid<AC> Not PII

        The SID of the Account that created the Application resource to fetch.

        sid
        Path
        get sid<AP> Not PII

        The Twilio-provided string that uniquely identifies the Application resource to fetch.

        Example 1
        Loading Code Sample...
              
              

              Fetch an Application

              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
              Parameters in REST API format
              account_sid
              Path
              get sid<AC> Not PII

              The SID of the Account that created the Application resources to read.

              friendly_name
              Optional
              get string Not PII

              The string that identifies the Application resources to read.

              Example 1
              Loading Code Sample...
                    
                    

                    List All Application Resource Representations

                    Example 2
                    Loading Code Sample...
                          
                          

                          Return the Application named "MyApp"

                          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
                          Parameters in REST API format
                          account_sid
                          Path
                          post sid<AC> Not PII

                          The SID of the Account that created the Application resources to update.

                          sid
                          Path
                          post sid<AP> Not PII

                          The Twilio-provided string that uniquely identifies the Application resource to update.

                          friendly_name
                          Optional
                          post string Not PII

                          A descriptive string that you create to describe the resource. It can be up to 64 characters long.

                          api_version
                          Optional
                          post string Not PII

                          The API version to use to start a new TwiML session. Can be: 2010-04-01 or 2008-08-01. The default value is your account's default API version.

                          voice_url
                          Optional
                          post url Not PII

                          The URL we should call when the phone number assigned to this application receives a call.

                          voice_method
                          Optional
                          post http_method Not PII

                          The HTTP method we should use to call voice_url. Can be: GET or POST.

                          voice_fallback_url
                          Optional
                          post url Not PII

                          The URL that we should call when an error occurs retrieving or executing the TwiML requested by url.

                          voice_fallback_method
                          Optional
                          post http_method Not PII

                          The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

                          status_callback
                          Optional
                          post url Not PII

                          The URL we should call using the status_callback_method to send status information to your application.

                          status_callback_method
                          Optional
                          post http_method Not PII

                          The HTTP method we should use to call status_callback. Can be: GET or POST.

                          voice_caller_id_lookup
                          Optional
                          post boolean Not PII

                          Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true or false.

                          sms_url
                          Optional
                          post url Not PII

                          The URL we should call when the phone number receives an incoming SMS message.

                          sms_method
                          Optional
                          post http_method Not PII

                          The HTTP method we should use to call sms_url. Can be: GET or POST.

                          sms_fallback_url
                          Optional
                          post url Not PII

                          The URL that we should call when an error occurs while retrieving or executing the TwiML from sms_url.

                          sms_fallback_method
                          Optional
                          post http_method Not PII

                          The HTTP method we should use to call sms_fallback_url. Can be: GET or POST.

                          sms_status_callback
                          Optional
                          post url Not PII

                          Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility.

                          message_status_callback
                          Optional
                          post url Not PII

                          The URL we should call using a POST method to send message status information to your application.

                          public_application_connect_enabled
                          Optional
                          post boolean Not PII

                          Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true or false.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Set the VoiceUrl and SmsUrl on an Application to 'http://myapp.com/awesome'

                                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
                                Parameters in REST API format
                                account_sid
                                Path
                                delete sid<AC> Not PII

                                The SID of the Account that created the Application resources to delete.

                                sid
                                Path
                                delete sid<AP> Not PII

                                The Twilio-provided string that uniquely identifies the Application resource to delete.

                                Example 1
                                Loading Code Sample...
                                      
                                      

                                      Delete an Application

                                      Rate this page:

                                      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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                      Loading Code Sample...
                                            
                                            
                                            

                                            Thank you for your feedback!

                                            Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                            Sending your feedback...
                                            🎉 Thank you for your feedback!
                                            Something went wrong. Please try again.

                                            Thanks for your feedback!

                                            thanks-feedback-gif