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

API Getting Started: Compliance Information Update


(information)

Info

For general information about Regulatory Compliance APIs, go to Regulatory Compliance API Docs.


Who is this guide for?

who-is-this-guide-for page anchor

This guide is meant to serve developers who use Twilio's Regulatory Compliance APIs to build their own application that serves. By following this Getting Started guide, you as a developer can implement a self-service mechanism for your customers to update their compliance information without you manually having to communicate with them.

New API Resources

new-api-resources page anchor
  • Copies Resource
  • Replace Items Resource

A new parameter, ValidUntil, is being added to the Bundles resource. This new parameter is applied to a Bundle in the twilio-approved state but will be transitioned to a twilio-rejected state unless the compliance information is updated.


How do I update compliance information?

how-do-i-update-compliance-information page anchor

The first step is to know when a Regulation is updated that will create a call-to-action for you to update the compliance information of your affected Bundles. To do this, you should have a status callback webhook enabled for all of your Bundles. An email alias is required, so all information will always be sent to the email assigned to any affected Bundle. Once the Bundles have been identified, you will create a copy to begin updating all compliance information required. After updating the compliance information, submit the Bundle to Twilio for review. Once Twilio reviews and approves the newly updated compliance information, you will then replace all of the newly updated items to the original Bundle. This prevents you from having to reassign any dependencies such as Phone Numbers to a new Bundle. After the items have been replaced, delete the Bundle Copy to ensure you have a clean reference moving forward. Once completed, the Bundle will no longer have a ValidUntil date and everything is up to current compliance.

  1. Find all Bundles that require information to be updated/added
  2. Create a Bundle Copy to begin updating/adding information
  3. Run an Evaluation to find the exact incorrect or missing piece of information
  4. Retrieve list of Supporting Document(s) and End-User assigned to the Bundle
  5. Present and update Supporting Document(s) - [optional, if needs updating]
  6. Present and update End-User - [optional, if needs updating]
  7. Submit Bundle Copy for review
  8. Twilio reviews & approves Bundle
  9. After approval, replace Item Assignments from Bundle Copy to original Bundle
  10. Delete Bundle Copy

Below is an API sequence diagram illustrating the sequence of requests that will be performed within this Getting Started page of updating compliance information. The domain objects are abbreviated for brevity purposes.

Compliance Information Update Public API Sequence Diagram.

Step 0: Twilio will enact new requirements for a current active Regulation

step-0-twilio-will-enact-new-requirements-for-a-current-active-regulation page anchor

If you have configured the status callback webhook parameter on the Bundle, you will receive the following webhook request. Notice that there is a new field in the response; ValidUntil that acts as a date parameter when the Bundle will be moved to a twilio-rejected status unless the compliance information is updated. If you do not remember how to configure your status callback webhook, please refer to the Bundles Public API resource page. There is a table within the page that details the status callback parameters.


_10
{
_10
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"bundle_sid":"BUef3a237936fb63163fd852d77c5ba27b",
_10
"status":"twilio-approved",
_10
"valid_until":"2022-02-01T00:00:00Z",
_10
"failure_reason":""
_10
}

Step 1: Filter for all Bundles

step-1-filter-for-all-bundles page anchor

Besides the status callback webhooks and the email, your customers will need to filter all of their Bundles every time their job is to update compliance information. To find all of the Bundles that need their compliance information updated, Query the list of Bundles and apply the ValidUntil filter along with order by date descending.

Filter LIST for all twilio-approved Bundles with a ValidUntilDate

filter-list-for-all-twilio-approved-bundles-with-a-validuntildate page anchor
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 listBundle() {
_21
const bundles = await client.numbers.v2.regulatoryCompliance.bundles.list({
_21
hasValidUntilDate: true,
_21
sortBy: "valid-until",
_21
sortDirection: "DESC",
_21
limit: 20,
_21
});
_21
_21
bundles.forEach((b) => console.log(b.sid));
_21
}
_21
_21
listBundle();

Output

_31
{
_31
"results": [
_31
{
_31
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_31
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_31
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_31
"friendly_name": "friendly_name",
_31
"status": "twilio-approved",
_31
"email": "email",
_31
"status_callback": "http://www.example.com",
_31
"valid_until": "2022-11-29T01:00:00Z",
_31
"date_created": "2021-08-30T22:29:24Z",
_31
"date_updated": "2021-08-31T01:09:00Z",
_31
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_31
"links": {
_31
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_31
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
_31
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
_31
}
_31
}
_31
],
_31
"meta": {
_31
"page": 0,
_31
"page_size": 50,
_31
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?Status=twilio-approved&IsoCountry=AU&ValidUntilDate%3C=2022-11-29T23%3A59%3A59Z&NumberType=mobile&PageSize=50&Page=0",
_31
"previous_page_url": null,
_31
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?Status=twilio-approved&IsoCountry=AU&ValidUntilDate%3C=2022-11-29T23%3A59%3A59Z&NumberType=mobile&PageSize=50&Page=0",
_31
"next_page_url": null,
_31
"key": "results"
_31
}
_31
}

Step 2: Create a Copy of the Bundle

step-2-create-a-copy-of-the-bundle page anchor

After receiving the initial status callback webhook request, the next step is to take the Bundle SID from webhook request which included the valid_until parameter and create a new Copy of the Bundle. The new Bundle Copy will make a new instance of the Bundle and all of the Item Assignments consisting of an End-User and Supporting Document(s). These instances will allow you to update information while the original Bundle continues to stay in a twilio-approved compliance state that allows you to continue provisioning new Phone Numbers.

Note: By performing this operation via Public API, you are opting in to the full API lifecycle after the Bundle Copy has been approved. If the Bundle Copy operation is performed via Twilio's Console, the Bundle will opt-in to automated lifecycle transitioning after Twilio has reviewed and approved the Bundle Copy. For API operation, it is up to you to coordinate that lifecycle transition and management.

Create new Bundle Copy to begin Updating

create-new-bundle-copy-to-begin-updating page anchor
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 createBundleCopy() {
_18
const bundleCopy = await client.numbers.v2.regulatoryCompliance
_18
.bundles("BUef3a237936fb63163fd852d77c5ba27b")
_18
.bundleCopies.create({ friendlyName: "Copy Bundle Metadata" });
_18
_18
console.log(bundleCopy.sid);
_18
}
_18
_18
createBundleCopy();

Output

_12
{
_12
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "Copy Bundle Metadata",
_12
"status": "draft",
_12
"valid_until": "2015-07-30T20:00:00Z",
_12
"email": "email",
_12
"status_callback": "http://www.example.com",
_12
"date_created": "2015-07-30T20:00:00Z",
_12
"date_updated": "2015-07-30T20:00:00Z"
_12
}

Step 3: Determine why a newly updated Regulation will reject the Bundle Copy

step-3-determine-why-a-newly-updated-regulation-will-reject-the-bundle-copy page anchor

After understanding that a given Bundle will be valid until an expiration date and then creating a Bundle Copy, the next step is to understand what exactly is missing from the Bundle Copy. To retrieve the exact requirements of what information passed versus not, send a new create request to the Evaluations subresource of the Bundle instance. The response will provide the necessary information to add/remove any compliance information enforced by the new requirements of the Regulation.

Create new Evaluation of Bundle Copy to fill in what's missing

create-new-evaluation-of-bundle-copy-to-fill-in-whats-missing page anchor
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 createEvaluation() {
_18
const evaluation = await client.numbers.v2.regulatoryCompliance
_18
.bundles("BU504eddd19f1efa428458f6daed683667")
_18
.evaluations.create();
_18
_18
console.log(evaluation.results);
_18
}
_18
_18
createEvaluation();

Output

_160
{
_160
"sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_160
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_160
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_160
"bundle_sid": "BU504eddd19f1efa428458f6daed683667",
_160
"status": "noncompliant",
_160
"date_created": "2020-04-28T18:14:01Z",
_160
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_160
"results": [
_160
{
_160
"friendly_name": "Business",
_160
"object_type": "business",
_160
"passed": false,
_160
"failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22214,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "Business Name",
_160
"object_field": "business_name",
_160
"failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
_160
"error_code": 22215
_160
},
_160
{
_160
"friendly_name": "Business Registration Number",
_160
"object_field": "business_registration_number",
_160
"failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
_160
"error_code": 22215
_160
},
_160
{
_160
"friendly_name": "First Name",
_160
"object_field": "first_name",
_160
"failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
_160
"error_code": 22215
_160
},
_160
{
_160
"friendly_name": "Last Name",
_160
"object_field": "last_name",
_160
"failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
_160
"error_code": 22215
_160
}
_160
],
_160
"requirement_friendly_name": "Business",
_160
"requirement_name": "business_info"
_160
},
_160
{
_160
"friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
_160
"object_type": "commercial_registrar_excerpt",
_160
"passed": false,
_160
"failure_reason": "An Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "Business Name",
_160
"object_field": "business_name",
_160
"failure_reason": "The Business Name is missing. Or, it does not match the Business Name you entered within Business information. Please enter in the Business Name shown on the Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative or make sure both Business Name fields use the same exact inputs.",
_160
"error_code": 22217
_160
}
_160
],
_160
"requirement_friendly_name": "Business Name",
_160
"requirement_name": "business_name_info"
_160
},
_160
{
_160
"friendly_name": "Excerpt from the commercial register showing French address",
_160
"object_type": "commercial_registrar_excerpt",
_160
"passed": false,
_160
"failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "Address sid(s)",
_160
"object_field": "address_sids",
_160
"failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
_160
"error_code": 22219
_160
}
_160
],
_160
"requirement_friendly_name": "Business Address (Proof of Address)",
_160
"requirement_name": "business_address_proof_info"
_160
},
_160
{
_160
"friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
_160
"object_type": "commercial_registrar_excerpt",
_160
"passed": false,
_160
"failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "Document Number",
_160
"object_field": "document_number",
_160
"failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
_160
"error_code": 22217
_160
}
_160
],
_160
"requirement_friendly_name": "Business Registration Number",
_160
"requirement_name": "business_reg_no_info"
_160
},
_160
{
_160
"friendly_name": "Government-issued ID",
_160
"object_type": "government_issued_document",
_160
"passed": false,
_160
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "First Name",
_160
"object_field": "first_name",
_160
"failure_reason": "The First Name is missing. Or, it does not match the First Name you entered within Business information. Please enter in the First Name shown on the Government-issued ID or make sure both First Name fields use the same exact inputs.",
_160
"error_code": 22217
_160
},
_160
{
_160
"friendly_name": "Last Name",
_160
"object_field": "last_name",
_160
"failure_reason": "The Last Name is missing. Or, it does not match the Last Name you entered within Business information. Please enter in the Last Name shown on the Government-issued ID or make sure both Last Name fields use the same exact inputs.",
_160
"error_code": 22217
_160
}
_160
],
_160
"requirement_friendly_name": "Name of Authorized Representative",
_160
"requirement_name": "name_of_auth_rep_info"
_160
},
_160
{
_160
"friendly_name": "Executed Copy of Power of Attorney",
_160
"object_type": "power_of_attorney",
_160
"passed": false,
_160
"failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [],
_160
"requirement_friendly_name": "Power of Attorney",
_160
"requirement_name": "power_of_attorney_info"
_160
},
_160
{
_160
"friendly_name": "Government-issued ID",
_160
"object_type": "government_issued_document",
_160
"passed": false,
_160
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
_160
"error_code": 22216,
_160
"valid": [],
_160
"invalid": [
_160
{
_160
"friendly_name": "First Name",
_160
"object_field": "first_name",
_160
"failure_reason": "The First Name is missing on the Governnment-Issued ID.",
_160
"error_code": 22217
_160
},
_160
{
_160
"friendly_name": "Last Name",
_160
"object_field": "last_name",
_160
"failure_reason": "The Last Name is missing on the Government-issued ID",
_160
"error_code": 22217
_160
}
_160
],
_160
"requirement_friendly_name": "Name of Person granted the Power of Attorney",
_160
"requirement_name": "name_in_power_of_attorney_info"
_160
}
_160
]
_160
}

Step 4: Find Supporting Documents and End-Users to Update

step-4-find-supporting-documents-and-end-users-to-update page anchor

Go through the necessary steps to update the newly created Bundle Copy by either adding/removing information to the End-User and/or Supporting Document(s) assigned. Firstly, Retrieve a list of all Item Assignments from the Bundle Copy. Next step is to fetch the End-User instance (IT prefix) and the Supporting Document instance(s) (RD prefix). Analyzing the difference between the previously ran Evaluation against the End-User and Supporting Document(s) instances will allow you to see the exact parameters that need to be updated.

Retrieve a list of Item Assignments to update

retrieve-a-list-of-item-assignments-to-update page anchor
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 listItemAssignment() {
_18
const itemAssignments = await client.numbers.v2.regulatoryCompliance
_18
.bundles("BU504eddd19f1efa428458f6daed683667")
_18
.itemAssignments.list({ limit: 20 });
_18
_18
itemAssignments.forEach((i) => console.log(i.sid));
_18
}
_18
_18
listItemAssignment();

Output

_21
{
_21
"results": [
_21
{
_21
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"object_sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21
"date_created": "2019-07-31T02:34:41Z",
_21
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_21
}
_21
],
_21
"meta": {
_21
"page": 0,
_21
"page_size": 50,
_21
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments?PageSize=50&Page=0",
_21
"previous_page_url": null,
_21
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments?PageSize=50&Page=0",
_21
"next_page_url": null,
_21
"key": "results"
_21
}
_21
}

Step 5: Update Supporting Document(s)

step-5-update-supporting-documents page anchor

If the Evaluation that you previously requested determines that one or many Supporting Documents are missing information given the new requirements, you must update that information. First, show the user the Supporting Document instance and inform them exactly what is missing per the Evaluation. Allow the user to enter the information required and send an update operation for that instance. If there are more Supporting Documents that failed the Evaluation, repeat this step until finished.

Fetch the Supporting Document(s) instance

fetch-the-supporting-documents-instance page anchor
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 fetchSupportingDocument() {
_18
const supportingDocument = await client.numbers.v2.regulatoryCompliance
_18
.supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
_18
.fetch();
_18
_18
console.log(supportingDocument.sid);
_18
}
_18
_18
fetchSupportingDocument();

Output

_16
{
_16
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
_16
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16
"friendly_name": "friendly_name",
_16
"mime_type": "mime_type",
_16
"status": "draft",
_16
"failure_reason": null,
_16
"type": "type",
_16
"attributes": {
_16
"first_name": "foo",
_16
"last_name": "bar"
_16
},
_16
"date_created": "2019-07-31T02:11:52Z",
_16
"date_updated": "2019-07-31T02:11:52Z",
_16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_16
}

Update Supporting Document

update-supporting-document page anchor
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 updateSupportingDocument() {
_18
const supportingDocument = await client.numbers.v2.regulatoryCompliance
_18
.supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
_18
.update({ friendlyName: "FriendlyName" });
_18
_18
console.log(supportingDocument.sid);
_18
}
_18
_18
updateSupportingDocument();

Output

_16
{
_16
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
_16
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16
"friendly_name": "FriendlyName",
_16
"mime_type": "mime_type",
_16
"status": "draft",
_16
"failure_reason": null,
_16
"type": "type",
_16
"attributes": {
_16
"first_name": "foo",
_16
"last_name": "bar"
_16
},
_16
"date_created": "2019-07-31T02:11:52Z",
_16
"date_updated": "2019-07-31T02:11:52Z",
_16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_16
}

Step 6: Update End User

step-6-update-end-user page anchor

If the Evaluation that you previously requested determines that the End User is missing information given the new requirements, you must update that information. First, show the user the End-User instance and inform them exactly what is missing per the Evaluation. Allow the user to enter the information required and send an update operation for that instance.

Fetch the End-User Instance

fetch-the-end-user-instance page anchor
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 fetchEndUser() {
_18
const endUser = await client.numbers.v2.regulatoryCompliance
_18
.endUsers("ITb365fb008a947f565dc45b73f4641dab")
_18
.fetch();
_18
_18
console.log(endUser.sid);
_18
}
_18
_18
fetchEndUser();

Output

_12
{
_12
"sid": "ITb365fb008a947f565dc45b73f4641dab",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "friendly_name",
_12
"type": "individual",
_12
"attributes": {
_12
"email": "foobar@twilio.com"
_12
},
_12
"date_created": "2019-07-30T21:57:45Z",
_12
"date_updated": "2019-07-30T21:57:45Z",
_12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_12
}

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 updateEndUser() {
_18
const endUser = await client.numbers.v2.regulatoryCompliance
_18
.endUsers("ITb365fb008a947f565dc45b73f4641dab")
_18
.update({ friendlyName: "FriendlyName" });
_18
_18
console.log(endUser.sid);
_18
}
_18
_18
updateEndUser();

Output

_12
{
_12
"sid": "ITb365fb008a947f565dc45b73f4641dab",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "FriendlyName",
_12
"type": "individual",
_12
"attributes": {
_12
"email": "foobar@twilio.com"
_12
},
_12
"date_created": "2019-07-30T21:57:45Z",
_12
"date_updated": "2019-07-30T21:57:45Z",
_12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_12
}

Step 7: Submit Bundle Copy for Twilio to Review

step-7-submit-bundle-copy-for-twilio-to-review page anchor

After finishing the necessary updates, repeat Step 2 to create a new Evaluation instance with all of the updated information. By performing this check before submitting the Bundle Copy for Twilio to review, you can ensure that the request will be accepted.

Submit Bundle Copy for Twilio to Review

submit-bundle-copy-for-twilio-to-review page anchor
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 updateBundle() {
_18
const bundle = await client.numbers.v2.regulatoryCompliance
_18
.bundles("BU504eddd19f1efa428458f6daed683667")
_18
.update({ status: "pending-review" });
_18
_18
console.log(bundle.sid);
_18
}
_18
_18
updateBundle();

Output

_18
{
_18
"sid": "BU504eddd19f1efa428458f6daed683667",
_18
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"friendly_name": "friendly_name",
_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
}

Step 8: Twilio to Review Regulatory Bundle Copy

step-8-twilio-to-review-regulatory-bundle-copy page anchor

After receipt, Twilio will review the Bundle Copy within 24 hours business SLA. If approved, you will


_10
{
_10
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"bundle_sid":"BU504eddd19f1efa428458f6daed683667",
_10
"status":"twilio-approved",
_10
"failure_reason":""
_10
}

Note: If your Regulatory Bundle was rejected to one or more Supporting Document issues, you will be allowed to self-service fix your Supporting Documents by leveraging the FailureReason on the Supporting Document instances. By first referencing the Bundle Copy Item Assignments resource and then traversing to the Supporting Document instances for more detailed FailureReason information.

Step 9: Replace Item Assignments

step-9-replace-item-assignments page anchor

After the Bundle Copy has been reviewed and approved, it is up to you to replace the newly approved End-User Supporting Document(s) to the original Bundle. Once replaced, the valid until date parameter on the Bundle will be nulled out. By replacing only the Item Assignments, no Phone Numbers nor any other dependencies will have to be replacing and the history of the Bundle can continue.

Note: as explained in Step 1, by creating the Bundle Copy via Public API, you are responsible for replacing the Item Assignments and deleting the Bundle Copy after approval.

Replace Item Assignments

replace-item-assignments page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_12
{
_12
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "friendly_name",
_12
"status": "draft",
_12
"valid_until": "2015-07-30T20:00:00Z",
_12
"email": "email",
_12
"status_callback": "http://www.example.com",
_12
"date_created": "2015-07-30T20:00:00Z",
_12
"date_updated": "2015-07-30T20:00:00Z"
_12
}

Step 10: Delete Bundle Copy

step-10-delete-bundle-copy page anchor

To clean up any leftover data that no longer has a purpose to you or Twilio, you should now the Bundle Copy. The Bundle Copy no longer has any Item Assignments and thus is no longer usable.

Note: as explained in Step 1, by creating the Bundle Copy via Public API, you are responsible for replacing the Item Assignments and deleting the Bundle Copy after approval.

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("BU504eddd19f1efa428458f6daed683667")
_16
.remove();
_16
}
_16
_16
deleteBundle();


Rate this page: