Skip to contentSkip to navigationSkip to topbar
On this page

Incoming Phone Number Assigned Add-ons Subresource


This endpoint allows Add-on Listing users to see what installed Add-on Listings have been 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.

When an Add-on Listing is assigned to a specific Twilio phone number, it is only used for calls and messages associated with that particular phone number rather than the entire Twilio account.

Add-on Listings enabled for Recordings and TaskRouter do not 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 nameTypeRequiredDescriptionChild properties
sidSID<XE>

Optional

Not PII

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

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

account_sidSID<AC>

Optional

The SID of the Account that created the resource.

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

resource_sidSID<PN>

Optional

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

friendly_namestring

Optional

PII MTL: 30 days

The string that you assigned to describe the resource.


descriptionstring

Optional

A short description of the functionality that the Add-on provides.


configurationobject

Optional

A JSON string that represents the current configuration of this Add-on installation.


unique_namestring

Optional

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.


date_updatedstring<date-time-rfc-2822>

Optional

The date and time in GMT that the resource was last updated specified in RFC 2822(link takes you to an external page) format.


uristring

Optional

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


subresource_urisobject<uri-map>

Optional

A list of related resources identified by their relative URIs.


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 nameTypeRequiredDescriptionChild properties
InstalledAddOnSidSID<XE>required

The SID that identifies the Add-on installation.

Pattern: ^XE[0-9a-fA-F]{32}$Min length: 34Max length: 34
Create an AssignedAddOnLink to code sample: Create an AssignedAddOn
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();

Output

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
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();

Output

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

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.

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.sid));
16
}
17
18
listIncomingPhoneNumberAssignedAddOn();

Output

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
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();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.