Skip to contentSkip to navigationSkip to topbar
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 nameTypeRequiredDescriptionChild properties
sidSID<BU>

Optional

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>

Optional

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>

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

friendly_namestring

Optional

The string that you assigned to describe the resource.


statusenum<string>

Optional

The verification status of the Bundle resource.

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

emailstring

Optional

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


status_callbackstring<uri>

Optional

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


date_createdstring<date-time>

Optional

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>

Optional

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>

Optional

The absolute URL of the Bundle resource.


linksobject<uri-map>

Optional

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 (except for when it changes from pending-review to in_review), 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
AccountSIDThe SID of the Account that created the Bundle resource.
BundleSIDThe 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.
FailureReasonThe 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.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
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

IsoCountrystring

Optional

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

NumberTypestring

Optional

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


IsTestboolean

Optional

Indicates that Bundle is a Test Bundle and will be Auto-Rejected

Create a new BundleLink to code sample: Create a new Bundle
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 createBundle() {
11
const bundle = await client.numbers.v2.regulatoryCompliance.bundles.create({
12
email: "numbers-regulatory-review@twilio.com",
13
endUserType: "business",
14
friendlyName: "Twilio, Inc. DE Local Bundle",
15
isoCountry: "de",
16
numberType: "local",
17
statusCallback: "https://twilio.status.callback.com",
18
});
19
20
console.log(bundle.sid);
21
}
22
23
createBundle();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "Twilio, Inc. DE Local Bundle",
6
"status": "draft",
7
"email": "numbers-regulatory-review@twilio.com",
8
"status_callback": "https://twilio.status.callback.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
15
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
16
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
17
}
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
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 fetchBundle() {
11
const bundle = await client.numbers.v2.regulatoryCompliance
12
.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(bundle.sid);
16
}
17
18
fetchBundle();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "draft",
7
"valid_until": null,
8
"email": "email",
9
"status_callback": "http://www.example.com",
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
15
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
16
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
17
}
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

FriendlyNamestring

Optional

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

IsoCountrystring

Optional

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


NumberTypestring

Optional

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


HasValidUntilDateboolean

Optional

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.


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 listBundle() {
11
const bundles = await client.numbers.v2.regulatoryCompliance.bundles.list({
12
limit: 20,
13
});
14
15
bundles.forEach((b) => console.log(b.sid));
16
}
17
18
listBundle();

Output

1
{
2
"results": [],
3
"meta": {
4
"page": 0,
5
"page_size": 50,
6
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?PageSize=50&Page=0",
7
"previous_page_url": null,
8
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?PageSize=50&Page=0",
9
"next_page_url": null,
10
"key": "results"
11
}
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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
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.


FriendlyNamestring

Optional

The string that you assigned to describe the resource.


Emailstring

Optional

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

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 updateBundle() {
11
const bundle = await client.numbers.v2.regulatoryCompliance
12
.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({
14
friendlyName: "UpdatedSubmitedFriendlyName",
15
status: "pending-review",
16
});
17
18
console.log(bundle.sid);
19
}
20
21
updateBundle();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "UpdatedSubmitedFriendlyName",
6
"status": "pending-review",
7
"email": "email",
8
"status_callback": "http://www.example.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
15
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
16
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
17
}
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
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 deleteBundle() {
11
await client.numbers.v2.regulatoryCompliance
12
.bundles("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.remove();
14
}
15
16
deleteBundle();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.