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.
The SID of the Account that created the Application resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT that the resource was created specified in RFC 2822 format.
The date and time in GMT that the resource was last updated specified in RFC 2822 format.
The URL we call using a POST method to send message status information to your application.
The unique string that that we created to identify the Application resource.
^AP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The HTTP method we use to call sms_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we call when an error occurs while retrieving or executing the TwiML from sms_url
.
The HTTP method we use to call sms_url
. Can be: GET
or POST
.
GET
POST
The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
The URL we call when the phone number receives an incoming SMS message.
The URL we call using the status_callback_method
to send status information to your application.
The HTTP method we use to call status_callback
. Can be: GET
or POST
.
GET
POST
Whether we look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true
or false
.
The HTTP method we use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL that we call when an error occurs retrieving or executing the TwiML requested by url
.
The HTTP method we use to call voice_url
. Can be: GET
or POST
.
GET
POST
The URL we call when the phone number assigned to this application receives a call.
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true
or false
.
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.
application/x-www-form-urlencoded
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.
The URL we should call when the phone number assigned to this application receives a call.
The HTTP method we should use to call voice_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs retrieving or executing the TwiML requested by url
.
The HTTP method we should use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL we should call using the status_callback_method
to send status information to your application.
The HTTP method we should use to call status_callback
. Can be: GET
or POST
.
GET
POST
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true
or false
.
The URL we should call when the phone number receives an incoming SMS message.
The HTTP method we should use to call sms_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs while retrieving or executing the TwiML from sms_url
.
The HTTP method we should use to call sms_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL we should call using a POST method to send status information about SMS messages sent by the application.
The URL we should call using a POST method to send message status information to your application.
A descriptive string that you create to describe the new application. It can be up to 64 characters long.
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true
or false
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createApplication() {11const application = await client.applications.create({12friendlyName: "Phone Me",13voiceMethod: "GET",14voiceUrl: "http://demo.twilio.com/docs/voice.xml",15});1617console.log(application.accountSid);18}1920createApplication();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"date_created": "Mon, 22 Aug 2011 20:59:45 +0000",5"date_updated": "Tue, 18 Aug 2015 16:48:57 +0000",6"friendly_name": "Phone Me",7"message_status_callback": "http://www.example.com/sms-status-callback",8"sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"sms_fallback_method": "GET",10"sms_fallback_url": "http://www.example.com/sms-fallback",11"sms_method": "GET",12"sms_status_callback": "http://www.example.com/sms-status-callback",13"sms_url": "http://example.com",14"status_callback": "http://example.com",15"status_callback_method": "GET",16"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",17"voice_caller_id_lookup": false,18"voice_fallback_method": "GET",19"voice_fallback_url": "http://www.example.com/voice-callback",20"voice_method": "GET",21"voice_url": "http://demo.twilio.com/docs/voice.xml",22"public_application_connect_enabled": true23}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
The SID of the Account that created the Application resource to fetch.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Application resource to fetch.
^AP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchApplication() {11const application = await client12.applications("APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.fetch();1415console.log(application.accountSid);16}1718fetchApplication();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"date_created": "Mon, 22 Aug 2011 20:59:45 +0000",5"date_updated": "Tue, 18 Aug 2015 16:48:57 +0000",6"friendly_name": "Application Friendly Name",7"message_status_callback": "http://www.example.com/sms-status-callback",8"sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",9"sms_fallback_method": "GET",10"sms_fallback_url": "http://www.example.com/sms-fallback",11"sms_method": "GET",12"sms_status_callback": "http://www.example.com/sms-status-callback",13"sms_url": "http://example.com",14"status_callback": "http://example.com",15"status_callback_method": "GET",16"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",17"voice_caller_id_lookup": false,18"voice_fallback_method": "GET",19"voice_fallback_url": "http://www.example.com/voice-callback",20"voice_method": "GET",21"voice_url": "http://example.com",22"public_application_connect_enabled": false23}
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.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listApplication() {11const applications = await client.applications.list({ limit: 20 });1213applications.forEach((a) => console.log(a.accountSid));14}1516listApplication();
1{2"applications": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"api_version": "2010-04-01",6"date_created": "Fri, 21 Aug 2015 00:07:25 +0000",7"date_updated": "Fri, 21 Aug 2015 00:07:25 +0000",8"friendly_name": "d8821fb7-4d01-48b2-bdc5-34e46252b90b",9"message_status_callback": null,10"sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"sms_fallback_method": "POST",12"sms_fallback_url": null,13"sms_method": "POST",14"sms_status_callback": null,15"sms_url": null,16"status_callback": null,17"status_callback_method": "POST",18"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",19"voice_caller_id_lookup": false,20"voice_fallback_method": "POST",21"voice_fallback_url": null,22"voice_method": "POST",23"voice_url": null,24"public_application_connect_enabled": false25}26],27"end": 0,28"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=0",29"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=1&PageToken=PAAPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",30"previous_page_uri": null,31"page_size": 1,32"page": 0,33"start": 0,34"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=0"35}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listApplication() {11const applications = await client.applications.list({12friendlyName: "MyApp",13limit: 20,14});1516applications.forEach((a) => console.log(a.accountSid));17}1819listApplication();
1{2"applications": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"api_version": "2010-04-01",6"date_created": "Fri, 21 Aug 2015 00:07:25 +0000",7"date_updated": "Fri, 21 Aug 2015 00:07:25 +0000",8"friendly_name": "d8821fb7-4d01-48b2-bdc5-34e46252b90b",9"message_status_callback": null,10"sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"sms_fallback_method": "POST",12"sms_fallback_url": null,13"sms_method": "POST",14"sms_status_callback": null,15"sms_url": null,16"status_callback": null,17"status_callback_method": "POST",18"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",19"voice_caller_id_lookup": false,20"voice_fallback_method": "POST",21"voice_fallback_url": null,22"voice_method": "POST",23"voice_url": null,24"public_application_connect_enabled": false25}26],27"end": 0,28"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=0",29"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=1&PageToken=PAAPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",30"previous_page_uri": null,31"page_size": 1,32"page": 0,33"start": 0,34"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?FriendlyName=friendly_name&PageSize=1&Page=0"35}
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.
The SID of the Account that created the Application resources to update.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Application resource to update.
^AP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
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.
The URL we should call when the phone number assigned to this application receives a call.
The HTTP method we should use to call voice_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs retrieving or executing the TwiML requested by url
.
The HTTP method we should use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
The URL we should call using the status_callback_method
to send status information to your application.
The HTTP method we should use to call status_callback
. Can be: GET
or POST
.
GET
POST
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: true
or false
.
The URL we should call when the phone number receives an incoming SMS message.
The HTTP method we should use to call sms_url
. Can be: GET
or POST
.
GET
POST
The URL that we should call when an error occurs while retrieving or executing the TwiML from sms_url
.
The HTTP method we should use to call sms_fallback_url
. Can be: GET
or POST
.
GET
POST
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.
The URL we should call using a POST method to send message status information to your application.
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true
or false
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateApplication() {11const application = await client12.applications("AP2a0747eba6abf96b7e3c3ff0b4530f6e")13.update({14smsUrl: "http://demo.twilio.com/docs/sms.xml",15voiceUrl: "http://demo.twilio.com/docs/voice.xml",16});1718console.log(application.accountSid);19}2021updateApplication();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"api_version": "2010-04-01",4"date_created": "Mon, 22 Aug 2011 20:59:45 +0000",5"date_updated": "Tue, 18 Aug 2015 16:48:57 +0000",6"friendly_name": "Application Friendly Name",7"message_status_callback": "http://www.example.com/sms-status-callback",8"sid": "AP2a0747eba6abf96b7e3c3ff0b4530f6e",9"sms_fallback_method": "GET",10"sms_fallback_url": "http://www.example.com/sms-fallback",11"sms_method": "GET",12"sms_status_callback": "http://www.example.com/sms-status-callback",13"sms_url": "http://demo.twilio.com/docs/sms.xml",14"status_callback": "http://example.com",15"status_callback_method": "GET",16"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",17"voice_caller_id_lookup": false,18"voice_fallback_method": "GET",19"voice_fallback_url": "http://www.example.com/voice-callback",20"voice_method": "GET",21"voice_url": "http://demo.twilio.com/docs/voice.xml",22"public_application_connect_enabled": true23}
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.
The SID of the Account that created the Application resources to delete.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Application resource to delete.
^AP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteApplication() {11await client.applications("APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();12}1314deleteApplication();