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

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_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 = require('twilio')(accountSid, authToken);
_16
_16
client.numbers.v2.regulatoryCompliance
_16
.bundles
_16
.list({
_16
hasValidUntilDate: true,
_16
sortBy: 'valid-until',
_16
sortDirection: 'DESC',
_16
limit: 20
_16
})
_16
.then(bundles => bundles.forEach(b => console.log(b.sid)));

Output

_31
{
_31
"results": [
_31
{
_31
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_31
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_31
"regulation_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_31
"links": {
_31
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_31
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments",
_31
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/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": "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
"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": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?Status=twilio-approved&IsoCountry=AU&ValidUntilDate%3C=2022-11-29T23%3A59%3A59Z&NumberType=mobile&PageSize=50&Page=1",
_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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.numbers.v2.regulatoryCompliance
_12
.bundles('BUef3a237936fb63163fd852d77c5ba27b')
_12
.bundleCopies
_12
.create({friendlyName: 'Copy Bundle Metadata'})
_12
.then(bundle_copy => console.log(bundle_copy.sid));

Output

_12
{
_12
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12
"regulation_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.numbers.v2.regulatoryCompliance
_12
.bundles('BU504eddd19f1efa428458f6daed683667')
_12
.evaluations
_12
.create()
_12
.then(evaluation => console.log(evaluation.results));

Output

_160
{
_160
"sid": "ELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_160
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_160
"regulation_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_160
"bundle_sid": "BU504eddd19f1efa428458f6daed683667",
_160
"status": "noncompliant",
_160
"date_created": "2020-04-28T18:14:01Z",
_160
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations/ELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.numbers.v2.regulatoryCompliance
_12
.bundles('BU504eddd19f1efa428458f6daed683667')
_12
.itemAssignments
_12
.list({limit: 20})
_12
.then(itemAssignments => itemAssignments.forEach(i => console.log(i.sid)));

Output

_21
{
_21
"results": [
_21
{
_21
"sid": "BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"object_sid": "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"date_created": "2019-07-31T02:34:41Z",
_21
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments/BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_21
}
_21
],
_21
"meta": {
_21
"page": 0,
_21
"page_size": 50,
_21
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments?PageSize=50&Page=0",
_21
"previous_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments?PageSize=50&Page=0",
_21
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments?PageSize=50&Page=0",
_21
"next_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments?PageSize=50&Page=1",
_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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.supportingDocuments('RD45b349d9f268c66581786cc8b2e21bd6')
_11
.fetch()
_11
.then(supporting_document => console.log(supporting_document.friendlyName));

Output

_16
{
_16
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
_16
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_16
}

Update Supporting Document

update-supporting-document page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.supportingDocuments('RD45b349d9f268c66581786cc8b2e21bd6')
_11
.update({friendlyName: 'friendly_name'})
_11
.then(supporting_document => console.log(supporting_document.friendlyName));

Output

_16
{
_16
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
_16
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.endUsers('ITb365fb008a947f565dc45b73f4641dab')
_11
.fetch()
_11
.then(end_user => console.log(end_user.friendlyName));

Output

_12
{
_12
"sid": "ITb365fb008a947f565dc45b73f4641dab",
_12
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_12
}

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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.endUsers('ITb365fb008a947f565dc45b73f4641dab')
_11
.update({friendlyName: 'friendly_name'})
_11
.then(end_user => console.log(end_user.friendlyName));

Output

_12
{
_12
"sid": "ITb365fb008a947f565dc45b73f4641dab",
_12
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.bundles('BU504eddd19f1efa428458f6daed683667')
_11
.update({status: 'pending-review'})
_11
.then(bundle => console.log(bundle.friendlyName));

Output

_18
{
_18
"sid": "BU504eddd19f1efa428458f6daed683667",
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"regulation_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"links": {
_18
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_18
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ItemAssignments",
_18
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.numbers.v2.regulatoryCompliance
_12
.bundles('BUef3a237936fb63163fd852d77c5ba27b')
_12
.replaceItems
_12
.create({fromBundleSid: 'BU504eddd19f1efa428458f6daed683667'})
_12
.then(replace_items => console.log(replace_items.sid));

Output

_12
{
_12
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12
"regulation_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.numbers.v2.regulatoryCompliance
_10
.bundles('BU504eddd19f1efa428458f6daed683667')
_10
.remove();


Rate this page: