Skip to contentSkip to navigationSkip to topbar
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.

1
{
2
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"bundle_sid":"BUef3a237936fb63163fd852d77c5ba27b",
4
"status":"twilio-approved",
5
"valid_until":"2022-02-01T00:00:00Z",
6
"failure_reason":""
7
}
8

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 ValidUntilDateLink to code sample: Filter LIST for all twilio-approved Bundles with a ValidUntilDate
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
hasValidUntilDate: true,
13
sortBy: "valid-until",
14
sortDirection: "DESC",
15
limit: 20,
16
});
17
18
bundles.forEach((b) => console.log(b.sid));
19
}
20
21
listBundle();

Output

1
{
2
"results": [
3
{
4
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"friendly_name": "friendly_name",
8
"status": "twilio-approved",
9
"email": "email",
10
"status_callback": "http://www.example.com",
11
"valid_until": "2022-11-29T01:00:00Z",
12
"date_created": "2021-08-30T22:29:24Z",
13
"date_updated": "2021-08-31T01:09:00Z",
14
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
"links": {
16
"evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
17
"item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
18
"bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
19
}
20
}
21
],
22
"meta": {
23
"page": 0,
24
"page_size": 50,
25
"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",
26
"previous_page_url": null,
27
"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",
28
"next_page_url": null,
29
"key": "results"
30
}
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.

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 createBundleCopy() {
11
const bundleCopy = await client.numbers.v2.regulatoryCompliance
12
.bundles("BUef3a237936fb63163fd852d77c5ba27b")
13
.bundleCopies.create({ friendlyName: "Copy Bundle Metadata" });
14
15
console.log(bundleCopy.sid);
16
}
17
18
createBundleCopy();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "Copy Bundle Metadata",
6
"status": "draft",
7
"valid_until": "2015-07-30T20:00:00Z",
8
"email": "email",
9
"status_callback": "http://www.example.com",
10
"date_created": "2015-07-30T20:00:00Z",
11
"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 missingLink to code sample: Create new Evaluation of Bundle Copy to fill in what's missing
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 createEvaluation() {
11
const evaluation = await client.numbers.v2.regulatoryCompliance
12
.bundles("BU504eddd19f1efa428458f6daed683667")
13
.evaluations.create();
14
15
console.log(evaluation.results);
16
}
17
18
createEvaluation();

Output

1
{
2
"sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"bundle_sid": "BU504eddd19f1efa428458f6daed683667",
6
"status": "noncompliant",
7
"date_created": "2020-04-28T18:14:01Z",
8
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"results": [
10
{
11
"friendly_name": "Business",
12
"object_type": "business",
13
"passed": false,
14
"failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
15
"error_code": 22214,
16
"valid": [],
17
"invalid": [
18
{
19
"friendly_name": "Business Name",
20
"object_field": "business_name",
21
"failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
22
"error_code": 22215
23
},
24
{
25
"friendly_name": "Business Registration Number",
26
"object_field": "business_registration_number",
27
"failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
28
"error_code": 22215
29
},
30
{
31
"friendly_name": "First Name",
32
"object_field": "first_name",
33
"failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
34
"error_code": 22215
35
},
36
{
37
"friendly_name": "Last Name",
38
"object_field": "last_name",
39
"failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
40
"error_code": 22215
41
}
42
],
43
"requirement_friendly_name": "Business",
44
"requirement_name": "business_info"
45
},
46
{
47
"friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
48
"object_type": "commercial_registrar_excerpt",
49
"passed": false,
50
"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.",
51
"error_code": 22216,
52
"valid": [],
53
"invalid": [
54
{
55
"friendly_name": "Business Name",
56
"object_field": "business_name",
57
"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.",
58
"error_code": 22217
59
}
60
],
61
"requirement_friendly_name": "Business Name",
62
"requirement_name": "business_name_info"
63
},
64
{
65
"friendly_name": "Excerpt from the commercial register showing French address",
66
"object_type": "commercial_registrar_excerpt",
67
"passed": false,
68
"failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
69
"error_code": 22216,
70
"valid": [],
71
"invalid": [
72
{
73
"friendly_name": "Address sid(s)",
74
"object_field": "address_sids",
75
"failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
76
"error_code": 22219
77
}
78
],
79
"requirement_friendly_name": "Business Address (Proof of Address)",
80
"requirement_name": "business_address_proof_info"
81
},
82
{
83
"friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
84
"object_type": "commercial_registrar_excerpt",
85
"passed": false,
86
"failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
87
"error_code": 22216,
88
"valid": [],
89
"invalid": [
90
{
91
"friendly_name": "Document Number",
92
"object_field": "document_number",
93
"failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
94
"error_code": 22217
95
}
96
],
97
"requirement_friendly_name": "Business Registration Number",
98
"requirement_name": "business_reg_no_info"
99
},
100
{
101
"friendly_name": "Government-issued ID",
102
"object_type": "government_issued_document",
103
"passed": false,
104
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
105
"error_code": 22216,
106
"valid": [],
107
"invalid": [
108
{
109
"friendly_name": "First Name",
110
"object_field": "first_name",
111
"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.",
112
"error_code": 22217
113
},
114
{
115
"friendly_name": "Last Name",
116
"object_field": "last_name",
117
"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.",
118
"error_code": 22217
119
}
120
],
121
"requirement_friendly_name": "Name of Authorized Representative",
122
"requirement_name": "name_of_auth_rep_info"
123
},
124
{
125
"friendly_name": "Executed Copy of Power of Attorney",
126
"object_type": "power_of_attorney",
127
"passed": false,
128
"failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
129
"error_code": 22216,
130
"valid": [],
131
"invalid": [],
132
"requirement_friendly_name": "Power of Attorney",
133
"requirement_name": "power_of_attorney_info"
134
},
135
{
136
"friendly_name": "Government-issued ID",
137
"object_type": "government_issued_document",
138
"passed": false,
139
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
140
"error_code": 22216,
141
"valid": [],
142
"invalid": [
143
{
144
"friendly_name": "First Name",
145
"object_field": "first_name",
146
"failure_reason": "The First Name is missing on the Governnment-Issued ID.",
147
"error_code": 22217
148
},
149
{
150
"friendly_name": "Last Name",
151
"object_field": "last_name",
152
"failure_reason": "The Last Name is missing on the Government-issued ID",
153
"error_code": 22217
154
}
155
],
156
"requirement_friendly_name": "Name of Person granted the Power of Attorney",
157
"requirement_name": "name_in_power_of_attorney_info"
158
}
159
]
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 updateLink to code sample: Retrieve a list of Item Assignments to update
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 listItemAssignment() {
11
const itemAssignments = await client.numbers.v2.regulatoryCompliance
12
.bundles("BU504eddd19f1efa428458f6daed683667")
13
.itemAssignments.list({ limit: 20 });
14
15
itemAssignments.forEach((i) => console.log(i.sid));
16
}
17
18
listItemAssignment();

Output

1
{
2
"results": [
3
{
4
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"object_sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"date_created": "2019-07-31T02:34:41Z",
9
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
10
}
11
],
12
"meta": {
13
"page": 0,
14
"page_size": 50,
15
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments?PageSize=50&Page=0",
16
"previous_page_url": null,
17
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments?PageSize=50&Page=0",
18
"next_page_url": null,
19
"key": "results"
20
}
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.

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 fetchSupportingDocument() {
11
const supportingDocument = await client.numbers.v2.regulatoryCompliance
12
.supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
13
.fetch();
14
15
console.log(supportingDocument.sid);
16
}
17
18
fetchSupportingDocument();

Output

1
{
2
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "friendly_name",
5
"mime_type": "mime_type",
6
"status": "draft",
7
"failure_reason": null,
8
"errors": null,
9
"type": "type",
10
"attributes": {
11
"first_name": "foo",
12
"last_name": "bar"
13
},
14
"date_created": "2019-07-31T02:11:52Z",
15
"date_updated": "2019-07-31T02:11:52Z",
16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
}
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 updateSupportingDocument() {
11
const supportingDocument = await client.numbers.v2.regulatoryCompliance
12
.supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
13
.update({ friendlyName: "FriendlyName" });
14
15
console.log(supportingDocument.sid);
16
}
17
18
updateSupportingDocument();

Output

1
{
2
"sid": "RD45b349d9f268c66581786cc8b2e21bd6",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"mime_type": "mime_type",
6
"status": "draft",
7
"failure_reason": null,
8
"errors": null,
9
"type": "type",
10
"attributes": {
11
"first_name": "foo",
12
"last_name": "bar"
13
},
14
"date_created": "2019-07-31T02:11:52Z",
15
"date_updated": "2019-07-31T02:11:52Z",
16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
}

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.

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 fetchEndUser() {
11
const endUser = await client.numbers.v2.regulatoryCompliance
12
.endUsers("ITb365fb008a947f565dc45b73f4641dab")
13
.fetch();
14
15
console.log(endUser.sid);
16
}
17
18
fetchEndUser();

Output

1
{
2
"sid": "ITb365fb008a947f565dc45b73f4641dab",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "friendly_name",
5
"type": "individual",
6
"attributes": {
7
"email": "foobar@twilio.com"
8
},
9
"date_created": "2019-07-30T21:57:45Z",
10
"date_updated": "2019-07-30T21:57:45Z",
11
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
12
}
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 updateEndUser() {
11
const endUser = await client.numbers.v2.regulatoryCompliance
12
.endUsers("ITb365fb008a947f565dc45b73f4641dab")
13
.update({ friendlyName: "FriendlyName" });
14
15
console.log(endUser.sid);
16
}
17
18
updateEndUser();

Output

1
{
2
"sid": "ITb365fb008a947f565dc45b73f4641dab",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"type": "individual",
6
"attributes": {
7
"email": "foobar@twilio.com"
8
},
9
"date_created": "2019-07-30T21:57:45Z",
10
"date_updated": "2019-07-30T21:57:45Z",
11
"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.

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("BU504eddd19f1efa428458f6daed683667")
13
.update({ status: "pending-review" });
14
15
console.log(bundle.sid);
16
}
17
18
updateBundle();

Output

1
{
2
"sid": "BU504eddd19f1efa428458f6daed683667",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
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
}

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

1
{
2
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"bundle_sid":"BU504eddd19f1efa428458f6daed683667",
4
"status":"twilio-approved",
5
"failure_reason":""
6
}
7

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.

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 createReplaceItems() {
11
const replaceItem = await client.numbers.v2.regulatoryCompliance
12
.bundles("BUef3a237936fb63163fd852d77c5ba27b")
13
.replaceItems.create({
14
fromBundleSid: "BU504eddd19f1efa428458f6daed683667",
15
});
16
17
console.log(replaceItem.sid);
18
}
19
20
createReplaceItems();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "draft",
7
"valid_until": "2015-07-30T20:00:00Z",
8
"email": "email",
9
"status_callback": "http://www.example.com",
10
"date_created": "2015-07-30T20:00:00Z",
11
"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.

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("BU504eddd19f1efa428458f6daed683667")
13
.remove();
14
}
15
16
deleteBundle();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.