Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Bundles Resource


(warning)

Warning

The v2 Regulatory Compliance APIs are currently in Public Beta. No breaking changes in the API contract will occur when the API moves from Public Beta to GA.

The Twilio Bundles REST API allows you to create empty Regulatory Bundle containers. The Regulatory Bundles are Item Assignments of End-Users and Supporting Documents for regulatory compliance.

Depending on the configuration of the bundle, the bundle is being assessed against a Regulation (e.g., Germany local phone numbers for a business). Different Regulations need Item Assignments combinations of End-User Types and Supporting Document Types.


Bundles Response Properties

bundles-response-properties page anchor

The field of the Bundle resource response is in JSON. The type SID<BU> is a unique ID starting with letters BU. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.

Property nameTypePIIDescription
sidSID<BU>
Not PII

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

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

account_sidSID<AC>

The SID of the Account that created the Bundle resource.

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

regulation_sidSID<RN>

The unique string of a regulation that is associated to the Bundle resource.

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

friendly_namestring

The string that you assigned to describe the resource.


statusenum<string>

The verification status of the Bundle resource.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approvedprovisionally-approved

emailstring

The email address that will receive updates when the Bundle resource changes status.


status_callbackstring<uri>

The URL we call to inform your application of status changes.


date_createdstring<date-time>

The date and time in GMT when the resource was created specified in ISO 8601(link takes you to an external page) format.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


urlstring<uri>

The absolute URL of the Bundle resource.


linksobject<uri-map>

The URLs of the Assigned Items of the Bundle resource.

Bundle Statuses

bundle-statuses page anchor

The following statuses encompass the Bundle lifecycle.

StatusDescription
draftThe user has created a new Bundle that can be edited with Supporting Documents and End-User objects assigned.
pending-reviewWhen the user has finished the draft of the Bundle and submits to Twilio for review, the status moves from draft to pending-review.
in-reviewTwilio has moved the Bundle from pending-review to in-review. Once Twilio has finished review, the Bundle will go either to twilio-approved or twilio-rejected.
twilio-rejectedTwilio has reviewed the Bundle and has determined the Bundle does not meet the regulations.
twilio-approvedTwilio has reviewed the Bundle and has determined the Bundles does meet the regulations.

Every time the Bundle resource's status changes, Twilio sends a POST request to the URL specified in the Bundle's statusCallback property. The Content-Type of the request is application/x-www-form-urlencoded.

FieldDescription
Account SIDThe SID of the Account that created the Bundle resource.
Bundle SIDThe unique string that we created to identify the Bundle resource.
StatusThe verification status of the Bundle resource. See Bundle Statuses for a list of possible values.
Failure ReasonThe description(s) of what incorrect configuration the Regulatory Bundle currently has.

POST https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles

To provision or port a phone number to Twilio, you will need to create a new Bundle that will contain all the information required to follow local telco Regulations.

The Bundle is a container that references the required Regulatory Compliance information set forth by the regulating telecom body of the end-user who actually answers the phone call or receives the message.

When creating the Bundle, you will specify the following parameters IsoCountry, NumberType, and EndUserType so you can follow compliance for a Regulation.

Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired

The string that you assigned to describe the resource.


Emailstringrequired

The email address that will receive updates when the Bundle resource changes status.


StatusCallbackstring<uri>Optional

The URL we call to inform your application of status changes.


RegulationSidSID<RN>Optional

The unique string of a regulation that is associated to the Bundle resource.

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

IsoCountrystringOptional

The ISO country code(link takes you to an external page) of the Bundle's phone number country ownership request.


EndUserTypeenum<string>Optional

The type of End User of the Bundle resource.

Possible values:
individualbusiness

NumberTypestringOptional

The type of phone number of the Bundle's ownership request. Can be local, mobile, national, or toll free.

Create a new Bundle

create-a-new-bundle page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_23
// Download the helper library from https://www.twilio.com/docs/node/install
_23
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_23
_23
// Find your Account SID and Auth Token at twilio.com/console
_23
// and set the environment variables. See http://twil.io/secure
_23
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_23
const authToken = process.env.TWILIO_AUTH_TOKEN;
_23
const client = twilio(accountSid, authToken);
_23
_23
async function createBundle() {
_23
const bundle = await client.numbers.v2.regulatoryCompliance.bundles.create({
_23
email: "numbers-regulatory-review@twilio.com",
_23
endUserType: "business",
_23
friendlyName: "Twilio, Inc. DE Local Bundle",
_23
isoCountry: "de",
_23
numberType: "local",
_23
statusCallback: "https://twilio.status.callback.com",
_23
});
_23
_23
console.log(bundle.sid);
_23
}
_23
_23
createBundle();

Output

_18
{
_18
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"friendly_name": "Twilio, Inc. DE Local Bundle",
_18
"status": "draft",
_18
"email": "numbers-regulatory-review@twilio.com",
_18
"status_callback": "https://twilio.status.callback.com",
_18
"valid_until": null,
_18
"date_created": "2019-07-30T22:29:24Z",
_18
"date_updated": "2019-07-31T01:09:00Z",
_18
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"links": {
_18
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_18
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
_18
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
_18
}
_18
}


GET https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<BU>required

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

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchBundle() {
_18
const bundle = await client.numbers.v2.regulatoryCompliance
_18
.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(bundle.sid);
_18
}
_18
_18
fetchBundle();

Output

_18
{
_18
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"friendly_name": "friendly_name",
_18
"status": "draft",
_18
"valid_until": null,
_18
"email": "email",
_18
"status_callback": "http://www.example.com",
_18
"date_created": "2019-07-30T22:29:24Z",
_18
"date_updated": "2019-07-31T01:09:00Z",
_18
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"links": {
_18
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_18
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
_18
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
_18
}
_18
}


GET https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles

If your application requires local inbound connectivity in many number types within a country or with many countries, you will have to create many Regulatory Bundle containers with all necessary information.

Property nameTypeRequiredPIIDescription
Statusenum<string>Optional

The verification status of the Bundle resource. Please refer to Bundle Statuses for more details.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approvedprovisionally-approved

FriendlyNamestringOptional

The string that you assigned to describe the resource. The column can contain 255 variable characters.


RegulationSidSID<RN>Optional

The unique string of a Regulation resource that is associated to the Bundle resource.

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

IsoCountrystringOptional

The 2-digit ISO country code(link takes you to an external page) of the Bundle's phone number country ownership request.


NumberTypestringOptional

The type of phone number of the Bundle's ownership request. Can be local, mobile, national, or tollfree.


HasValidUntilDatebooleanOptional

Indicates that the Bundle is a valid Bundle until a specified expiration date.


SortByenum<string>Optional

Can be valid-until or date-updated. Defaults to date-created.

Possible values:
valid-untildate-updated

SortDirectionenum<string>Optional

Default is DESC. Can be ASC or DESC.

Possible values:
ASCDESC

ValidUntilDatestring<date-time>Optional

Date to filter Bundles having their valid_until_date before or after the specified date. Can be ValidUntilDate>= or ValidUntilDate<=. Both can be used in conjunction as well. ISO 8601(link takes you to an external page) is the acceptable date format.


ValidUntilDate<string<date-time>Optional

Date to filter Bundles having their valid_until_date before or after the specified date. Can be ValidUntilDate>= or ValidUntilDate<=. Both can be used in conjunction as well. ISO 8601(link takes you to an external page) is the acceptable date format.


ValidUntilDate>string<date-time>Optional

Date to filter Bundles having their valid_until_date before or after the specified date. Can be ValidUntilDate>= or ValidUntilDate<=. Both can be used in conjunction as well. ISO 8601(link takes you to an external page) is the acceptable date format.


PageSizeintegerOptional

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

Minimum: 1Maximum: 1000

PageintegerOptional

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

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listBundle() {
_18
const bundles = await client.numbers.v2.regulatoryCompliance.bundles.list({
_18
limit: 20,
_18
});
_18
_18
bundles.forEach((b) => console.log(b.sid));
_18
}
_18
_18
listBundle();

Output

_12
{
_12
"results": [],
_12
"meta": {
_12
"page": 0,
_12
"page_size": 50,
_12
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?PageSize=50&Page=0",
_12
"previous_page_url": null,
_12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?PageSize=50&Page=0",
_12
"next_page_url": null,
_12
"key": "results"
_12
}
_12
}


Update a Bundle instance

update-a-bundle-instance page anchor
POST https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<BU>required

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

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
Statusenum<string>Optional

The verification status of the Bundle resource.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approvedprovisionally-approved

StatusCallbackstring<uri>Optional

The URL we call to inform your application of status changes.


FriendlyNamestringOptional

The string that you assigned to describe the resource.


EmailstringOptional

The email address that will receive updates when the Bundle resource changes status.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function updateBundle() {
_21
const bundle = await client.numbers.v2.regulatoryCompliance
_21
.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_21
.update({
_21
friendlyName: "UpdatedSubmitedFriendlyName",
_21
status: "pending-review",
_21
});
_21
_21
console.log(bundle.sid);
_21
}
_21
_21
updateBundle();

Output

_18
{
_18
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"friendly_name": "UpdatedSubmitedFriendlyName",
_18
"status": "pending-review",
_18
"email": "email",
_18
"status_callback": "http://www.example.com",
_18
"valid_until": null,
_18
"date_created": "2019-07-30T22:29:24Z",
_18
"date_updated": "2019-07-31T01:09:00Z",
_18
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"links": {
_18
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_18
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
_18
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
_18
}
_18
}


Delete a Bundle instance

delete-a-bundle-instance page anchor
DELETE https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/{Sid}

The DELETE operation is allowed for Regulatory Bundles with status of DRAFT, TWILIO_APPROVED, or TWILIO_REJECTED and have no active Long Code phone number assignments.

Property nameTypeRequiredPIIDescription
SidSID<BU>required

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

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function deleteBundle() {
_16
await client.numbers.v2.regulatoryCompliance
_16
.bundles("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_16
.remove();
_16
}
_16
_16
deleteBundle();


Rate this page: