Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Incoming Phone Number Assigned Add-ons Subresource


This endpoint allows Add-on Listing users to see the installed Add-on Listings assigned to a given Twilio phone number. It also allows users to assign and unassign an installed Add-on Listing to an incoming phone number.

Add-on Listings assigned to a specific Twilio phone number are used only for calls and messages associated with that phone number rather than the entire Twilio account.

Add-on Listings enabled for Recordings and TaskRouter don't support phone number assignments.

(information)

Info

This API only supports Add-on Listings that are in General Availability (GA) or Beta state. Listings that are labeled as Coming Soon or Developer Preview are not accessible via the API and must be managed in the Console.


AssignedAddOn Properties

assignedaddon-properties page anchor
Property nameTypeRequiredPIIDescriptionChild properties
endinteger

Optional

Not PII

firstPageUristring<uri>

Optional


nextPageUristring<uri>

Optional


pageinteger

Optional


pageSizeinteger

Optional


previousPageUristring<uri>

Optional


startinteger

Optional


uristring<uri>

Optional


assignedAddOnsarray[object]

Optional


Assign an Add-on installation to the Number specified

assign-an-add-on-installation-to-the-number-specified page anchor

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
accountSidSID<AC>
required

The SID of the Account that will create the resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

resourceSidSID<PN>
required

The SID of the Phone Number to assign the Add-on.

Pattern: ^PN[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
installedAddOnSidSID<XE>
required

The SID that identifies the Add-on installation.

Pattern: ^XE[0-9a-fA-F]{32}$Min length: 34Max length: 34
Assign an Add-on installation to the Number specifiedLink to code sample: Assign an Add-on installation to the Number specified
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createIncomingPhoneNumberAssignedAddOn() {
11
const assignedAddOn = await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns.create({
14
installedAddOnSid: "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(assignedAddOn.sid);
18
}
19
20
createIncomingPhoneNumberAssignedAddOn();

Response

Note about this response
1
{
2
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "VoiceBase High Accuracy Transcription",
6
"description": "Automatic Transcription and Keyword Extract...",
7
"configuration": {
8
"bad_words": true
9
},
10
"unique_name": "voicebase_high_accuracy_transcription",
11
"date_created": "Thu, 07 Apr 2016 23:52:28 +0000",
12
"date_updated": "Thu, 07 Apr 2016 23:52:28 +0000",
13
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
14
"subresource_uris": {
15
"extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json"
16
}
17
}

Fetch an instance of an Add-on installation currently assigned to this Number

fetch-an-instance-of-an-add-on-installation-currently-assigned-to-this-number page anchor

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{Sid}.json

Property nameTypeRequiredPIIDescription
accountSidSID<AC>
required

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

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

resourceSidSID<PN>
required

The SID of the Phone Number to which the Add-on is assigned.

Pattern: ^PN[0-9a-fA-F]{32}$Min length: 34Max length: 34

sidSID<XE>
required

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

Pattern: ^XE[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch an instance of an Add-on installation currently assigned to this NumberLink to code sample: Fetch an instance of an Add-on installation currently assigned to this Number
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchIncomingPhoneNumberAssignedAddOn() {
11
const assignedAddOn = await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
14
.fetch();
15
16
console.log(assignedAddOn.sid);
17
}
18
19
fetchIncomingPhoneNumberAssignedAddOn();

Response

Note about this response
1
{
2
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "VoiceBase High Accuracy Transcription",
6
"description": "Automatic Transcription and Keyword Extract...",
7
"configuration": {
8
"bad_words": true
9
},
10
"unique_name": "voicebase_high_accuracy_transcription",
11
"date_created": "Thu, 07 Apr 2016 23:52:28 +0000",
12
"date_updated": "Thu, 07 Apr 2016 23:52:28 +0000",
13
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
14
"subresource_uris": {
15
"extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json"
16
}
17
}

Retrieve a list of Add-on installations currently assigned to this Number

retrieve-a-list-of-add-on-installations-currently-assigned-to-this-number page anchor

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns.json

Property nameTypeRequiredPIIDescription
accountSidSID<AC>
required

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

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

resourceSidSID<PN>
required

The SID of the Phone Number to which the Add-on is assigned.

Pattern: ^PN[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
pageSizeinteger<int64>

Optional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

pageinteger

Optional

The page index. This value is simply for client state.

Minimum: 0

pageTokenstring

Optional

The page token. This is provided by the API.

Retrieve a list of Add-on installations currently assigned to this NumberLink to code sample: Retrieve a list of Add-on installations currently assigned to this Number
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listIncomingPhoneNumberAssignedAddOn() {
11
const assignedAddOns = await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns.list({ limit: 20 });
14
15
assignedAddOns.forEach((a) => console.log(a.end));
16
}
17
18
listIncomingPhoneNumberAssignedAddOn();

Response

Note about this response
1
{
2
"end": 0,
3
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0",
4
"next_page_uri": null,
5
"page": 0,
6
"page_size": 50,
7
"previous_page_uri": null,
8
"assigned_add_ons": [
9
{
10
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
11
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
12
"resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"friendly_name": "VoiceBase High Accuracy Transcription",
14
"description": "Automatic Transcription and Keyword Extract...",
15
"configuration": {
16
"bad_words": true
17
},
18
"unique_name": "voicebase_high_accuracy_transcription",
19
"date_created": "Thu, 07 Apr 2016 23:52:28 +0000",
20
"date_updated": "Thu, 07 Apr 2016 23:52:28 +0000",
21
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
22
"subresource_uris": {
23
"extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json"
24
}
25
}
26
],
27
"start": 0,
28
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0"
29
}

Remove the assignment of an Add-on installation from the Number specified

remove-the-assignment-of-an-add-on-installation-from-the-number-specified page anchor

DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{ResourceSid}/AssignedAddOns/{Sid}.json

Property nameTypeRequiredPIIDescription
accountSidSID<AC>
required

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

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

resourceSidSID<PN>
required

The SID of the Phone Number to which the Add-on is assigned.

Pattern: ^PN[0-9a-fA-F]{32}$Min length: 34Max length: 34

sidSID<XE>
required

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

Pattern: ^XE[0-9a-fA-F]{32}$Min length: 34Max length: 34
Remove the assignment of an Add-on installation from the Number specifiedLink to code sample: Remove the assignment of an Add-on installation from the Number specified
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteIncomingPhoneNumberAssignedAddOn() {
11
await client
12
.incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
14
.remove();
15
}
16
17
deleteIncomingPhoneNumberAssignedAddOn();