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.
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.
The unique string that we created to identify the Bundle resource.
^BU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Bundle resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string of a regulation that is associated to the Bundle resource.
^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The verification status of the Bundle resource.
draft
pending-review
in-review
twilio-rejected
twilio-approved
provisionally-approved
The date and time in GMT in ISO 8601 format when the resource will be valid until.
The email address that will receive updates when the Bundle resource changes status.
The URL we call to inform your application of status changes.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The URLs of the Assigned Items of the Bundle resource.
The following statuses encompass the Bundle lifecycle.
Status | Description |
---|---|
draft | The user has created a new Bundle that can be edited with Supporting Documents and End-User objects assigned. |
pending-review | When the user has finished the draft of the Bundle and submits to Twilio for review, the status moves from draft to pending-review . |
in-review | Twilio 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-rejected | Twilio has reviewed the Bundle and has determined the Bundle does not meet the regulations. |
twilio-approved | Twilio 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
.
Field | Description |
---|---|
Account SID | The SID of the Account that created the Bundle resource. |
Bundle SID | The unique string that we created to identify the Bundle resource. |
Status | The verification status of the Bundle resource. See Bundle Statuses for a list of possible values. |
Failure Reason | The 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.
application/x-www-form-urlencoded
The email address that will receive updates when the Bundle resource changes status.
The URL we call to inform your application of status changes.
The unique string of a regulation that is associated to the Bundle resource.
^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The ISO country code of the Bundle's phone number country ownership request.
The type of End User of the Bundle resource.
individual
business
The type of phone number of the Bundle's ownership request. Can be local
, mobile
, national
, or toll-free
.
Indicates that Bundle is a Test Bundle and will be Auto-Rejected
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 createBundle() {11const bundle = await client.numbers.v2.regulatoryCompliance.bundles.create({12email: "numbers-regulatory-review@twilio.com",13endUserType: "business",14friendlyName: "Twilio, Inc. DE Local Bundle",15isoCountry: "de",16numberType: "local",17statusCallback: "https://twilio.status.callback.com",18});1920console.log(bundle.sid);21}2223createBundle();
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}
The unique string that we created to identify the Bundle resource.
^BU[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 fetchBundle() {11const bundle = await client.numbers.v2.regulatoryCompliance12.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(bundle.sid);16}1718fetchBundle();
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.
The verification status of the Bundle resource. Please refer to Bundle Statuses for more details.
draft
pending-review
in-review
twilio-rejected
twilio-approved
provisionally-approved
The string that you assigned to describe the resource. The column can contain 255 variable characters.
The unique string of a Regulation resource that is associated to the Bundle resource.
^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The 2-digit ISO country code of the Bundle's phone number country ownership request.
The type of phone number of the Bundle's ownership request. Can be local
, mobile
, national
, or toll-free
.
Indicates that the Bundle is a valid Bundle until a specified expiration date.
Can be valid-until
or date-updated
. Defaults to date-created
.
valid-until
date-updated
Default is DESC
. Can be ASC
or DESC
.
ASC
DESC
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 is the acceptable date format.
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 is the acceptable date format.
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 is the acceptable date format.
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 listBundle() {11const bundles = await client.numbers.v2.regulatoryCompliance.bundles.list({12limit: 20,13});1415bundles.forEach((b) => console.log(b.sid));16}1718listBundle();
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}
POST https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/{Sid}
The unique string that we created to identify the Bundle resource.
^BU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
The verification status of the Bundle resource.
draft
pending-review
in-review
twilio-rejected
twilio-approved
provisionally-approved
The URL we call to inform your application of status changes.
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/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 updateBundle() {11const bundle = await client.numbers.v2.regulatoryCompliance12.bundles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({14friendlyName: "UpdatedSubmitedFriendlyName",15status: "pending-review",16});1718console.log(bundle.sid);19}2021updateBundle();
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 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.
The unique string that we created to identify the Bundle resource.
^BU[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 deleteBundle() {11await client.numbers.v2.regulatoryCompliance12.bundles("BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.remove();14}1516deleteBundle();