# API Getting Started: Compliance Information Update

> \[!NOTE]
>
> For general information about Regulatory Compliance APIs, go to [Regulatory Compliance API Docs](/docs/phone-numbers/regulatory/api).

## Who is this guide for?

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

* [Copies Resource](/docs/phone-numbers/regulatory/api/copies-resource)
* [Replace Items Resource](/docs/phone-numbers/regulatory/api/replace-items-resource)

### New API Parameter

A new parameter, `ValidUntil`, is being added to the [Bundles resource](/docs/phone-numbers/regulatory/api/bundles). 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?

The first step is to know when a [Regulation](/docs/phone-numbers/regulatory/api/regulations) 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

## API Sequence Diagram

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.

![Sequence diagram showing customer compliance update process via Twilio APIs.](https://docs-resources.prod.twilio.com/951d914b760dade4c1c31e37a2095593dd0358149801ea455116df92f418399c.png)

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

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](/docs/phone-numbers/regulatory/api/bundles). There is a table within the page that details the [status callback parameters](/docs/phone-numbers/regulatory/api/bundles#status-callback).

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

```

### Step 1: Filter for all Bundles

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\`

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listBundle() {
  const bundles = await client.numbers.v2.regulatoryCompliance.bundles.list({
    hasValidUntilDate: true,
    sortBy: "valid-until",
    sortDirection: "DESC",
    limit: 20,
  });

  bundles.forEach((b) => console.log(b.sid));
}

listBundle();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

bundles = client.numbers.v2.regulatory_compliance.bundles.list(
    has_valid_until_date=True,
    sort_by="valid-until",
    sort_direction="DESC",
    limit=20,
)

for record in bundles:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var bundles = await BundleResource.ReadAsync(
            hasValidUntilDate: true,
            sortBy: BundleResource.SortByEnum.ValidUntil,
            sortDirection: BundleResource.SortDirectionEnum.Desc,
            limit: 20);

        foreach (var record in bundles) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.Bundle;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Bundle> bundles = Bundle.reader()
                                          .setHasValidUntilDate(true)
                                          .setSortBy(Bundle.SortBy.VALID_UNTIL)
                                          .setSortDirection(Bundle.SortDirection.DESC)
                                          .limit(20)
                                          .read();

        for (Bundle record : bundles) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.ListBundleParams{}
	params.SetHasValidUntilDate(true)
	params.SetSortBy("valid-until")
	params.SetSortDirection("DESC")
	params.SetLimit(20)

	resp, err := client.NumbersV2.ListBundle(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$bundles = $twilio->numbers->v2->regulatoryCompliance->bundles->read(
    [
        "hasValidUntilDate" => true,
        "sortBy" => "valid-until",
        "sortDirection" => "DESC",
    ],
    20
);

foreach ($bundles as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

bundles = @client
          .numbers
          .v2
          .regulatory_compliance
          .bundles
          .list(
            has_valid_until_date: true,
            sort_by: 'valid-until',
            sort_direction: 'DESC',
            limit: 20
          )

bundles.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:list \
   --has-valid-until-date \
   --sort-by valid-until \
   --sort-direction DESC
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles?HasValidUntilDate=true&SortBy=valid-until&SortDirection=DESC&PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "results": [
    {
      "sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "friendly_name": "friendly_name",
      "status": "twilio-approved",
      "email": "email",
      "status_callback": "http://www.example.com",
      "valid_until": "2022-11-29T01:00:00Z",
      "date_created": "2021-08-30T22:29:24Z",
      "date_updated": "2021-08-31T01:09:00Z",
      "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "links": {
        "evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
        "item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
        "bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
      }
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "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",
    "previous_page_url": null,
    "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",
    "next_page_url": null,
    "key": "results"
  }
}
```

### Step 2: Create a Copy of the Bundle

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](/docs/phone-numbers/regulatory/api/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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createBundleCopy() {
  const bundleCopy = await client.numbers.v2.regulatoryCompliance
    .bundles("BUef3a237936fb63163fd852d77c5ba27b")
    .bundleCopies.create({ friendlyName: "Copy Bundle Metadata" });

  console.log(bundleCopy.sid);
}

createBundleCopy();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

bundle_copy = client.numbers.v2.regulatory_compliance.bundles(
    "BUef3a237936fb63163fd852d77c5ba27b"
).bundle_copies.create(friendly_name="Copy Bundle Metadata")

print(bundle_copy.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance.Bundle;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var bundleCopy = await BundleCopyResource.CreateAsync(
            friendlyName: "Copy Bundle Metadata",
            pathBundleSid: "BUef3a237936fb63163fd852d77c5ba27b");

        Console.WriteLine(bundleCopy.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.bundle.BundleCopy;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        BundleCopy bundleCopy =
            BundleCopy.creator("BUef3a237936fb63163fd852d77c5ba27b").setFriendlyName("Copy Bundle Metadata").create();

        System.out.println(bundleCopy.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.CreateBundleCopyParams{}
	params.SetFriendlyName("Copy Bundle Metadata")

	resp, err := client.NumbersV2.CreateBundleCopy("BUef3a237936fb63163fd852d77c5ba27b",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$bundle_copy = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BUef3a237936fb63163fd852d77c5ba27b")
    ->bundleCopies->create(["friendlyName" => "Copy Bundle Metadata"]);

print $bundle_copy->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

bundle_copy = @client
              .numbers
              .v2
              .regulatory_compliance
              .bundles('BUef3a237936fb63163fd852d77c5ba27b')
              .bundle_copies
              .create(friendly_name: 'Copy Bundle Metadata')

puts bundle_copy.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:copies:create \
   --bundle-sid BUef3a237936fb63163fd852d77c5ba27b \
   --friendly-name "Copy Bundle Metadata"
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUef3a237936fb63163fd852d77c5ba27b/Copies" \
--data-urlencode "FriendlyName=Copy Bundle Metadata" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

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

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](/docs/phone-numbers/regulatory/api/copies-resource). To retrieve the exact requirements of what information passed versus not, send a new create request to the [Evaluations subresource](/docs/phone-numbers/regulatory/api/evaluations) 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](/docs/phone-numbers/regulatory/api/regulations).

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createEvaluation() {
  const evaluation = await client.numbers.v2.regulatoryCompliance
    .bundles("BU504eddd19f1efa428458f6daed683667")
    .evaluations.create();

  console.log(evaluation.results);
}

createEvaluation();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

evaluation = client.numbers.v2.regulatory_compliance.bundles(
    "BU504eddd19f1efa428458f6daed683667"
).evaluations.create()

print(evaluation.results)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance.Bundle;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var evaluation = await EvaluationResource.CreateAsync(
            pathBundleSid: "BU504eddd19f1efa428458f6daed683667");

        Console.WriteLine(evaluation.Results);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.bundle.Evaluation;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Evaluation evaluation = Evaluation.creator("BU504eddd19f1efa428458f6daed683667").create();

        System.out.println(evaluation.getResults());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.NumbersV2.CreateEvaluation("BU504eddd19f1efa428458f6daed683667")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Results != nil {
			for _, item := range *resp.Results {
				fmt.Println(item)
			}
		} else {
			fmt.Println(resp.Results)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$evaluation = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BU504eddd19f1efa428458f6daed683667")
    ->evaluations->create();

print $evaluation->results;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

evaluation = @client
             .numbers
             .v2
             .regulatory_compliance
             .bundles('BU504eddd19f1efa428458f6daed683667')
             .evaluations
             .create

puts evaluation.results
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:evaluations:create \
   --bundle-sid BU504eddd19f1efa428458f6daed683667
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BU504eddd19f1efa428458f6daed683667/Evaluations" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

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

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listItemAssignment() {
  const itemAssignments = await client.numbers.v2.regulatoryCompliance
    .bundles("BU504eddd19f1efa428458f6daed683667")
    .itemAssignments.list({ limit: 20 });

  itemAssignments.forEach((i) => console.log(i.sid));
}

listItemAssignment();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

item_assignments = client.numbers.v2.regulatory_compliance.bundles(
    "BU504eddd19f1efa428458f6daed683667"
).item_assignments.list(limit=20)

for record in item_assignments:
    print(record.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance.Bundle;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var itemAssignments = await ItemAssignmentResource.ReadAsync(
            pathBundleSid: "BU504eddd19f1efa428458f6daed683667", limit: 20);

        foreach (var record in itemAssignments) {
            Console.WriteLine(record.Sid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.bundle.ItemAssignment;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<ItemAssignment> itemAssignments =
            ItemAssignment.reader("BU504eddd19f1efa428458f6daed683667").limit(20).read();

        for (ItemAssignment record : itemAssignments) {
            System.out.println(record.getSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.ListItemAssignmentParams{}
	params.SetLimit(20)

	resp, err := client.NumbersV2.ListItemAssignment("BU504eddd19f1efa428458f6daed683667",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Sid != nil {
				fmt.Println(*resp[record].Sid)
			} else {
				fmt.Println(resp[record].Sid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$itemAssignments = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BU504eddd19f1efa428458f6daed683667")
    ->itemAssignments->read(20);

foreach ($itemAssignments as $record) {
    print $record->sid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

item_assignments = @client
                   .numbers
                   .v2
                   .regulatory_compliance
                   .bundles('BU504eddd19f1efa428458f6daed683667')
                   .item_assignments
                   .list(limit: 20)

item_assignments.each do |record|
   puts record.sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:item-assignments:list \
   --bundle-sid BU504eddd19f1efa428458f6daed683667
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BU504eddd19f1efa428458f6daed683667/ItemAssignments?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Step 5: Update Supporting Document(s)

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchSupportingDocument() {
  const supportingDocument = await client.numbers.v2.regulatoryCompliance
    .supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
    .fetch();

  console.log(supportingDocument.sid);
}

fetchSupportingDocument();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

supporting_document = (
    client.numbers.v2.regulatory_compliance.supporting_documents(
        "RD45b349d9f268c66581786cc8b2e21bd6"
    ).fetch()
)

print(supporting_document.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var supportingDocument = await SupportingDocumentResource.FetchAsync(
            pathSid: "RD45b349d9f268c66581786cc8b2e21bd6");

        Console.WriteLine(supportingDocument.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.SupportingDocument;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SupportingDocument supportingDocument =
            SupportingDocument.fetcher("RD45b349d9f268c66581786cc8b2e21bd6").fetch();

        System.out.println(supportingDocument.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.NumbersV2.FetchSupportingDocument("RD45b349d9f268c66581786cc8b2e21bd6")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$supporting_document = $twilio->numbers->v2->regulatoryCompliance
    ->supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
    ->fetch();

print $supporting_document->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

supporting_document = @client
                      .numbers
                      .v2
                      .regulatory_compliance
                      .supporting_documents('RD45b349d9f268c66581786cc8b2e21bd6')
                      .fetch

puts supporting_document.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:supporting-documents:fetch \
   --sid RD45b349d9f268c66581786cc8b2e21bd6
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RD45b349d9f268c66581786cc8b2e21bd6" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

Update Supporting Document

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateSupportingDocument() {
  const supportingDocument = await client.numbers.v2.regulatoryCompliance
    .supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
    .update({ friendlyName: "FriendlyName" });

  console.log(supportingDocument.sid);
}

updateSupportingDocument();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

supporting_document = (
    client.numbers.v2.regulatory_compliance.supporting_documents(
        "RD45b349d9f268c66581786cc8b2e21bd6"
    ).update(friendly_name="FriendlyName")
)

print(supporting_document.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var supportingDocument = await SupportingDocumentResource.UpdateAsync(
            friendlyName: "FriendlyName", pathSid: "RD45b349d9f268c66581786cc8b2e21bd6");

        Console.WriteLine(supportingDocument.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.SupportingDocument;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SupportingDocument supportingDocument =
            SupportingDocument.updater("RD45b349d9f268c66581786cc8b2e21bd6").setFriendlyName("FriendlyName").update();

        System.out.println(supportingDocument.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.UpdateSupportingDocumentParams{}
	params.SetFriendlyName("FriendlyName")

	resp, err := client.NumbersV2.UpdateSupportingDocument("RD45b349d9f268c66581786cc8b2e21bd6",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$supporting_document = $twilio->numbers->v2->regulatoryCompliance
    ->supportingDocuments("RD45b349d9f268c66581786cc8b2e21bd6")
    ->update(["friendlyName" => "FriendlyName"]);

print $supporting_document->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

supporting_document = @client
                      .numbers
                      .v2
                      .regulatory_compliance
                      .supporting_documents('RD45b349d9f268c66581786cc8b2e21bd6')
                      .update(friendly_name: 'FriendlyName')

puts supporting_document.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:supporting-documents:update \
   --sid RD45b349d9f268c66581786cc8b2e21bd6 \
   --friendly-name FriendlyName
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RD45b349d9f268c66581786cc8b2e21bd6" \
--data-urlencode "FriendlyName=FriendlyName" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Step 6: Update End User

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchEndUser() {
  const endUser = await client.numbers.v2.regulatoryCompliance
    .endUsers("ITb365fb008a947f565dc45b73f4641dab")
    .fetch();

  console.log(endUser.sid);
}

fetchEndUser();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

end_user = client.numbers.v2.regulatory_compliance.end_users(
    "ITb365fb008a947f565dc45b73f4641dab"
).fetch()

print(end_user.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var endUser =
            await EndUserResource.FetchAsync(pathSid: "ITb365fb008a947f565dc45b73f4641dab");

        Console.WriteLine(endUser.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.EndUser;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        EndUser endUser = EndUser.fetcher("ITb365fb008a947f565dc45b73f4641dab").fetch();

        System.out.println(endUser.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.NumbersV2.FetchEndUser("ITb365fb008a947f565dc45b73f4641dab")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$end_user = $twilio->numbers->v2->regulatoryCompliance
    ->endUsers("ITb365fb008a947f565dc45b73f4641dab")
    ->fetch();

print $end_user->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

end_user = @client
           .numbers
           .v2
           .regulatory_compliance
           .end_users('ITb365fb008a947f565dc45b73f4641dab')
           .fetch

puts end_user.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:end-users:fetch \
   --sid ITb365fb008a947f565dc45b73f4641dab
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITb365fb008a947f565dc45b73f4641dab" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

Update End-User

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateEndUser() {
  const endUser = await client.numbers.v2.regulatoryCompliance
    .endUsers("ITb365fb008a947f565dc45b73f4641dab")
    .update({ friendlyName: "FriendlyName" });

  console.log(endUser.sid);
}

updateEndUser();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

end_user = client.numbers.v2.regulatory_compliance.end_users(
    "ITb365fb008a947f565dc45b73f4641dab"
).update(friendly_name="FriendlyName")

print(end_user.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var endUser = await EndUserResource.UpdateAsync(
            friendlyName: "FriendlyName", pathSid: "ITb365fb008a947f565dc45b73f4641dab");

        Console.WriteLine(endUser.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.EndUser;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        EndUser endUser =
            EndUser.updater("ITb365fb008a947f565dc45b73f4641dab").setFriendlyName("FriendlyName").update();

        System.out.println(endUser.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.UpdateEndUserParams{}
	params.SetFriendlyName("FriendlyName")

	resp, err := client.NumbersV2.UpdateEndUser("ITb365fb008a947f565dc45b73f4641dab",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$end_user = $twilio->numbers->v2->regulatoryCompliance
    ->endUsers("ITb365fb008a947f565dc45b73f4641dab")
    ->update(["friendlyName" => "FriendlyName"]);

print $end_user->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

end_user = @client
           .numbers
           .v2
           .regulatory_compliance
           .end_users('ITb365fb008a947f565dc45b73f4641dab')
           .update(friendly_name: 'FriendlyName')

puts end_user.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:end-users:update \
   --sid ITb365fb008a947f565dc45b73f4641dab \
   --friendly-name FriendlyName
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITb365fb008a947f565dc45b73f4641dab" \
--data-urlencode "FriendlyName=FriendlyName" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Step 7: Submit Bundle Copy for Twilio to Review

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateBundle() {
  const bundle = await client.numbers.v2.regulatoryCompliance
    .bundles("BU504eddd19f1efa428458f6daed683667")
    .update({ status: "pending-review" });

  console.log(bundle.sid);
}

updateBundle();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

bundle = client.numbers.v2.regulatory_compliance.bundles(
    "BU504eddd19f1efa428458f6daed683667"
).update(status="pending-review")

print(bundle.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var bundle = await BundleResource.UpdateAsync(
            status: BundleResource.StatusEnum.PendingReview,
            pathSid: "BU504eddd19f1efa428458f6daed683667");

        Console.WriteLine(bundle.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.Bundle;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Bundle bundle =
            Bundle.updater("BU504eddd19f1efa428458f6daed683667").setStatus(Bundle.Status.PENDING_REVIEW).update();

        System.out.println(bundle.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.UpdateBundleParams{}
	params.SetStatus("pending-review")

	resp, err := client.NumbersV2.UpdateBundle("BU504eddd19f1efa428458f6daed683667",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$bundle = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BU504eddd19f1efa428458f6daed683667")
    ->update(["status" => "pending-review"]);

print $bundle->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

bundle = @client
         .numbers
         .v2
         .regulatory_compliance
         .bundles('BU504eddd19f1efa428458f6daed683667')
         .update(status: 'pending-review')

puts bundle.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:update \
   --sid BU504eddd19f1efa428458f6daed683667 \
   --status pending-review
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BU504eddd19f1efa428458f6daed683667" \
--data-urlencode "Status=pending-review" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "BU504eddd19f1efa428458f6daed683667",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "friendly_name",
  "status": "pending-review",
  "email": "email",
  "status_callback": "http://www.example.com",
  "valid_until": null,
  "date_created": "2019-07-30T22:29:24Z",
  "date_updated": "2019-07-31T01:09:00Z",
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "links": {
    "evaluations": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
    "item_assignments": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments",
    "bundle_copies": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Copies"
  }
}
```

### Step 8: Twilio to Review Regulatory Bundle Copy

After receipt, Twilio will review the Bundle Copy within [24 hours business SLA](/docs/phone-numbers/regulatory/faq). If approved, you will

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

```

***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

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

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createReplaceItems() {
  const replaceItem = await client.numbers.v2.regulatoryCompliance
    .bundles("BUef3a237936fb63163fd852d77c5ba27b")
    .replaceItems.create({
      fromBundleSid: "BU504eddd19f1efa428458f6daed683667",
    });

  console.log(replaceItem.sid);
}

createReplaceItems();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

replace_item = client.numbers.v2.regulatory_compliance.bundles(
    "BUef3a237936fb63163fd852d77c5ba27b"
).replace_items.create(from_bundle_sid="BU504eddd19f1efa428458f6daed683667")

print(replace_item.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance.Bundle;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var replaceItems = await ReplaceItemsResource.CreateAsync(
            fromBundleSid: "BU504eddd19f1efa428458f6daed683667",
            pathBundleSid: "BUef3a237936fb63163fd852d77c5ba27b");

        Console.WriteLine(replaceItems.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.bundle.ReplaceItems;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ReplaceItems replaceItems =
            ReplaceItems.creator("BUef3a237936fb63163fd852d77c5ba27b", "BU504eddd19f1efa428458f6daed683667").create();

        System.out.println(replaceItems.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	numbers "github.com/twilio/twilio-go/rest/numbers/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &numbers.CreateReplaceItemsParams{}
	params.SetFromBundleSid("BU504eddd19f1efa428458f6daed683667")

	resp, err := client.NumbersV2.CreateReplaceItems("BUef3a237936fb63163fd852d77c5ba27b",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$replace_item = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BUef3a237936fb63163fd852d77c5ba27b")
    ->replaceItems->create(
        "BU504eddd19f1efa428458f6daed683667" // FromBundleSid
    );

print $replace_item->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

replace_item = @client
               .numbers
               .v2
               .regulatory_compliance
               .bundles('BUef3a237936fb63163fd852d77c5ba27b')
               .replace_items
               .create(from_bundle_sid: 'BU504eddd19f1efa428458f6daed683667')

puts replace_item.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:replace-items:create \
   --bundle-sid BUef3a237936fb63163fd852d77c5ba27b \
   --from-bundle-sid BU504eddd19f1efa428458f6daed683667
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUef3a237936fb63163fd852d77c5ba27b/ReplaceItems" \
--data-urlencode "FromBundleSid=BU504eddd19f1efa428458f6daed683667" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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

### Step 10: Delete Bundle Copy

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.

Delete Bundle Copy

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteBundle() {
  await client.numbers.v2.regulatoryCompliance
    .bundles("BU504eddd19f1efa428458f6daed683667")
    .remove();
}

deleteBundle();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.numbers.v2.regulatory_compliance.bundles(
    "BU504eddd19f1efa428458f6daed683667"
).delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Numbers.V2.RegulatoryCompliance;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await BundleResource.DeleteAsync(pathSid: "BU504eddd19f1efa428458f6daed683667");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.Bundle;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Bundle.deleter("BU504eddd19f1efa428458f6daed683667").delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	err := client.NumbersV2.DeleteBundle("BU504eddd19f1efa428458f6daed683667")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->numbers->v2->regulatoryCompliance
    ->bundles("BU504eddd19f1efa428458f6daed683667")
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .numbers
  .v2
  .regulatory_compliance
  .bundles('BU504eddd19f1efa428458f6daed683667')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:numbers:v2:regulatory-compliance:bundles:remove \
   --sid BU504eddd19f1efa428458f6daed683667
```

```bash
curl -X DELETE "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BU504eddd19f1efa428458f6daed683667" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
