# Getting Started: Regulatory Compliance Public REST APIs

## v2 RC APIs Workflow \[#v2-rc-api]

In the new v2 service, many of the objects will be re-usable. The re-usability of objects allows you to build and construct `Regulatory Bundles` at scale without having to create the same `End-User` or `Supporting Document` for each number group that you wish to lease.

The workflow for v2 below depicts both the `Regulatory Bundles` and `Supporting Documents` state machines. These workflows are crucial to providing a scalable and transparent process for both Twilio's customers and Twilio's customer's end-users through critical [PII](/docs/glossary/what-is-personally-identifiable-information-pii) abstraction.

![Flowchart of regulatory bundle workflow from draft to third-party acceptance or rejection.](https://docs-resources.prod.twilio.com/bc5ee08b1cd24c61ac12c39fe84998de5d292fde0fb2e983bd59ad43a576b1bc.png)

## Read a Regulation of a Bundle \[#regulation-read]

Before creating a new `Regulatory Bundle`, you will need to understand the requirements of a Regulation.

A Regulation instance unique per `IsoCountry`, `NumberType`, and `EndUserType` .

### Query parameters

```json
[{"name":"EndUserType","in":"query","description":"The type of End User the regulation requires - can be `individual` or `business`.","schema":{"type":"string","enum":["individual","business"],"description":"The type of End User the regulation requires - can be `individual` or `business`.","refName":"regulation_enum_end_user_type","modelName":"regulation_enum_end_user_type"},"examples":{"readEmpty":{"value":"business"}}},{"name":"IsoCountry","in":"query","description":"The ISO country code of the phone number's country.","schema":{"type":"string"},"examples":{"readEmpty":{"value":"US"}}},{"name":"NumberType","in":"query","description":"The type of phone number that the regulatory requiremnt is restricting.","schema":{"type":"string"},"examples":{"readEmpty":{"value":"mobile"}}},{"name":"IncludeConstraints","in":"query","description":"A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields","schema":{"type":"boolean"},"examples":{"readEmpty":{"value":true}}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

Read a Regulation

```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 listRegulation() {
  const regulations =
    await client.numbers.v2.regulatoryCompliance.regulations.list({
      endUserType: "individual",
      isoCountry: "au",
      numberType: "local",
      limit: 20,
    });

  regulations.forEach((r) => console.log(r.sid));
}

listRegulation();
```

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

regulations = client.numbers.v2.regulatory_compliance.regulations.list(
    end_user_type="individual", iso_country="au", number_type="local", limit=20
)

for record in regulations:
    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 regulations = await RegulationResource.ReadAsync(
            endUserType: RegulationResource.EndUserTypeEnum.Individual,
            isoCountry: "au",
            numberType: "local",
            limit: 20);

        foreach (var record in regulations) {
            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.Regulation;
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<Regulation> regulations = Regulation.reader()
                                                  .setEndUserType(Regulation.EndUserType.INDIVIDUAL)
                                                  .setIsoCountry("au")
                                                  .setNumberType("local")
                                                  .limit(20)
                                                  .read();

        for (Regulation record : regulations) {
            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.ListRegulationParams{}
	params.SetEndUserType("individual")
	params.SetIsoCountry("au")
	params.SetNumberType("local")
	params.SetLimit(20)

	resp, err := client.NumbersV2.ListRegulation(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);

$regulations = $twilio->numbers->v2->regulatoryCompliance->regulations->read(
    [
        "endUserType" => "individual",
        "isoCountry" => "au",
        "numberType" => "local",
    ],
    20
);

foreach ($regulations 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)

regulations = @client
              .numbers
              .v2
              .regulatory_compliance
              .regulations
              .list(
                end_user_type: 'individual',
                iso_country: 'au',
                number_type: 'local',
                limit: 20
              )

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

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

twilio api:numbers:v2:regulatory-compliance:regulations:list \
   --end-user-type individual \
   --iso-country au \
   --number-type local
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?EndUserType=individual&IsoCountry=au&NumberType=local&PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "results": [
    {
      "sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "friendly_name": "Australia: Local - Individual",
      "iso_country": "AU",
      "number_type": "local",
      "end_user_type": "individual",
      "requirements": {
        "end_user": [
          {
            "name": "Individual",
            "type": "individual",
            "requirement_name": "individual_info",
            "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
            "fields": [
              "first_name",
              "last_name"
            ],
            "detailed_fields": [
              {
                "machine_name": "first_name",
                "friendly_name": "First Name",
                "description": "First name of the Individual"
              },
              {
                "machine_name": "last_name",
                "friendly_name": "Last Name",
                "description": "Last name of the Individual"
              }
            ]
          }
        ],
        "supporting_document": [
          [
            {
              "name": "Address",
              "type": "document",
              "requirement_name": "proof_of_address",
              "description": "The physical location of the individual or business. Must be within locality or region covered by the phone numbers prefix; a PO Box is not acceptable where a local address is required.",
              "accepted_documents": [
                {
                  "name": "Address Validation",
                  "type": "address",
                  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
                  "fields": [
                    "address_sids"
                  ],
                  "detailed_fields": [
                    {
                      "machine_name": "address_sids",
                      "friendly_name": "Address sid(s)",
                      "description": "Address sid of the individual"
                    }
                  ]
                }
              ]
            }
          ]
        ]
      },
      "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "results"
  }
}
```

## Create a new Regulatory Bundles \[#bundle-create]

To begin the process of creating a new `Regulatory Bundle`, you will need to specify either the following three parameters:

`IsoCountry`, `NumberType`, and `EndUserType`

or

the `RegulationSid`.

Either of those options will provide the metadata required to create the `Regulatory Bundle` container for `Supporting Documents` and `End-Users` to be assigned to.

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateBundleRequest","required":["FriendlyName","Email"],"properties":{"FriendlyName":{"type":"string","description":"The string that you assigned to describe the resource."},"Email":{"type":"string","description":"The email address that will receive updates when the Bundle resource changes status."},"StatusCallback":{"type":"string","format":"uri","description":"The URL we call to inform your application of status changes."},"RegulationSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RN[0-9a-fA-F]{32}$","description":"The unique string of a regulation that is associated to the Bundle resource."},"IsoCountry":{"type":"string","description":"The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request."},"EndUserType":{"type":"string","enum":["individual","business"],"refName":"bundle_enum_end_user_type","modelName":"bundle_enum_end_user_type"},"NumberType":{"type":"string","description":"The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`."},"IsTest":{"type":"boolean","description":"Indicates that Bundle is a Test Bundle and will be Auto-Rejected"}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Email\": \"email\",\n  \"RegulationSid\": \"RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"StatusCallback\": \"http://www.example.com\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Email\": \"email\",\n  \"RegulationSid\": \"RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"StatusCallback\": \"http://www.example.com\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Email\"","#7EE787"],[":","#C9D1D9"]," ",["\"email\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"RegulationSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"StatusCallback\"","#7EE787"],[":","#C9D1D9"]," ",["\"http://www.example.com\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a new Bundle

```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 createBundle() {
  const bundle = await client.numbers.v2.regulatoryCompliance.bundles.create({
    email: "numbers-regulatory-review@twilio.com",
    endUserType: "business",
    friendlyName: "Twilio GmbH",
    isoCountry: "de",
    numberType: "local",
    statusCallback: "https://my.status.callback.com",
  });

  console.log(bundle.sid);
}

createBundle();
```

```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.create(
    email="numbers-regulatory-review@twilio.com",
    end_user_type="business",
    iso_country="de",
    number_type="local",
    friendly_name="Twilio GmbH",
    status_callback="https://my.status.callback.com",
)

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.CreateAsync(
            email: "numbers-regulatory-review@twilio.com",
            endUserType: BundleResource.EndUserTypeEnum.Business,
            isoCountry: "de",
            numberType: "local",
            friendlyName: "Twilio GmbH",
            statusCallback: new Uri("https://my.status.callback.com"));

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

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

import java.net.URI;
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.creator("Twilio GmbH", "numbers-regulatory-review@twilio.com")
                            .setEndUserType(Bundle.EndUserType.BUSINESS)
                            .setIsoCountry("de")
                            .setNumberType("local")
                            .setStatusCallback(URI.create("https://my.status.callback.com"))
                            .create();

        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.CreateBundleParams{}
	params.SetEmail("numbers-regulatory-review@twilio.com")
	params.SetEndUserType("business")
	params.SetIsoCountry("de")
	params.SetNumberType("local")
	params.SetFriendlyName("Twilio GmbH")
	params.SetStatusCallback("https://my.status.callback.com")

	resp, err := client.NumbersV2.CreateBundle(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->create(
    "Twilio GmbH", // FriendlyName
    "numbers-regulatory-review@twilio.com", // Email
    [
        "endUserType" => "business",
        "isoCountry" => "de",
        "numberType" => "local",
        "statusCallback" => "https://my.status.callback.com",
    ]
);

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
         .create(
           email: 'numbers-regulatory-review@twilio.com',
           end_user_type: 'business',
           iso_country: 'de',
           number_type: 'local',
           friendly_name: 'Twilio GmbH',
           status_callback: 'https://my.status.callback.com'
         )

puts bundle.sid
```

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

twilio api:numbers:v2:regulatory-compliance:bundles:create \
   --email numbers-regulatory-review@twilio.com \
   --end-user-type business \
   --iso-country de \
   --number-type local \
   --friendly-name "Twilio GmbH" \
   --status-callback https://my.status.callback.com
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles" \
--data-urlencode "Email=numbers-regulatory-review@twilio.com" \
--data-urlencode "EndUserType=business" \
--data-urlencode "IsoCountry=de" \
--data-urlencode "NumberType=local" \
--data-urlencode "FriendlyName=Twilio GmbH" \
--data-urlencode "StatusCallback=https://my.status.callback.com" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "Twilio GmbH",
  "status": "draft",
  "email": "numbers-regulatory-review@twilio.com",
  "status_callback": "https://my.status.callback.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"
  }
}
```

## Create a new End-User \[#end-user-create]

Once you successfully create the Bundle, you will either need to create a *new* `End-User`. If you have an End-User you've already created that you'd like to use, you can bypass this step.

The `End-User` is the `individual` or `business` that answers the phone call or message - whichever type you selected in the destination `Regulatory Bundle` container.

The end-user's information will be sent to the regulating body of the phone number's originating country.

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateEndUserRequest","required":["FriendlyName","Type"],"properties":{"FriendlyName":{"type":"string","description":"The string that you assigned to describe the resource."},"Type":{"type":"string","enum":["individual","business"],"description":"The type of end user of the Bundle resource - can be `individual` or `business`.","refName":"end_user_enum_type","modelName":"end_user_enum_type"},"Attributes":{"description":"The set of parameters that are the attributes of the End User resource which are derived End User Types.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Type\": \"individual\",\n  \"Attributes\": \"{}\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Type\": \"individual\",\n  \"Attributes\": \"{}\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Type\"","#7EE787"],[":","#C9D1D9"]," ",["\"individual\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Attributes\"","#7EE787"],[":","#C9D1D9"]," ",["\"{}\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a new 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 createEndUser() {
  const endUser = await client.numbers.v2.regulatoryCompliance.endUsers.create({
    attributes: {
      business_name: "Twilio",
    },
    friendlyName: "Twilio GmbH",
    type: "business",
  });

  console.log(endUser.sid);
}

createEndUser();
```

```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.create(
    friendly_name="Twilio GmbH",
    type="business",
    attributes={"business_name": "Twilio"},
)

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;
using System.Collections.Generic;

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.CreateAsync(
            friendlyName: "Twilio GmbH",
            type: EndUserResource.TypeEnum.Business,
            attributes: new Dictionary<string, Object>() { { "business_name", "Twilio" } });

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

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

import java.util.HashMap;
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.creator("Twilio GmbH", EndUser.Type.BUSINESS)
                              .setAttributes(new HashMap<String, Object>() {
                                  {
                                      put("business_name", "Twilio");
                                  }
                              })
                              .create();

        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.CreateEndUserParams{}
	params.SetFriendlyName("Twilio GmbH")
	params.SetType("business")
	params.SetAttributes(map[string]interface{}{
		"business_name": "Twilio",
	})

	resp, err := client.NumbersV2.CreateEndUser(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->create(
    "Twilio GmbH", // FriendlyName
    "business", // Type
    [
        "attributes" => [
            "business_name" => "Twilio",
        ],
    ]
);

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
           .create(
             friendly_name: 'Twilio GmbH',
             type: 'business',
             attributes: {
               'business_name' => 'Twilio'
             }
           )

puts end_user.sid
```

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

twilio api:numbers:v2:regulatory-compliance:end-users:create \
   --friendly-name "Twilio GmbH" \
   --type business \
   --attributes "{\"business_name\":\"Twilio\"}"
```

```bash
ATTRIBUTES_OBJ=$(cat << EOF
{
  "business_name": "Twilio"
}
EOF
)
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers" \
--data-urlencode "FriendlyName=Twilio GmbH" \
--data-urlencode "Type=business" \
--data-urlencode "Attributes=$ATTRIBUTES_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "Twilio GmbH",
  "type": "business",
  "attributes": {
    "business_name": "Twilio"
  },
  "date_created": "2019-07-30T21:57:45Z",
  "date_updated": "2019-07-30T21:57:45Z",
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Create a new Supporting Document \[#supporting-document-create]

For regulated number groups, documentation is required. This supporting documentation can vary from metadata to a file upload requirement.

The `Supporting Documents` resource allows you to create and manage `Supporting Documents` that can be assigned to multiple `Regulatory Bundle` containers.

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateSupportingDocumentRequest","required":["FriendlyName","Type"],"properties":{"FriendlyName":{"type":"string","description":"The string that you assigned to describe the resource."},"Type":{"type":"string","description":"The type of the Supporting Document."},"Attributes":{"description":"The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Type\": \"type\",\n  \"Attributes\": \"{}\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"Type\": \"type\",\n  \"Attributes\": \"{}\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Type\"","#7EE787"],[":","#C9D1D9"]," ",["\"type\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Attributes\"","#7EE787"],[":","#C9D1D9"]," ",["\"{}\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a new 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 createSupportingDocument() {
  const supportingDocument =
    await client.numbers.v2.regulatoryCompliance.supportingDocuments.create({
      attributes: {
        registered_seat_of_business:
          "375 Beale St, San Francisco 94133, California USA",
        document_number: "4389237",
        business_name: "Twilio",
        issue_date: "2020-12-05",
      },
      friendlyName: "TwilioBusinessRegistration",
      type: "business_registration",
    });

  console.log(supportingDocument.sid);
}

createSupportingDocument();
```

```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.create(
    friendly_name="TwilioBusinessRegistration",
    type="business_registration",
    attributes={
        "registered_seat_of_business": "375 Beale St, San Francisco 94133, California USA",
        "document_number": "4389237",
        "business_name": "Twilio",
        "issue_date": "2020-12-05",
    },
)

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;
using System.Collections.Generic;

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.CreateAsync(
            friendlyName: "TwilioBusinessRegistration",
            type: "business_registration",
            attributes: new Dictionary<string, Object>() {
                { "registered_seat_of_business",
                  "375 Beale St, San Francisco 94133, California USA" },
                { "document_number", "4389237" },
                { "business_name", "Twilio" },
                { "issue_date", "2020-12-05" }
            });

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

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

import java.util.HashMap;
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.creator("TwilioBusinessRegistration", "business_registration")
                .setAttributes(new HashMap<String, Object>() {
                    {
                        put("registered_seat_of_business", "375 Beale St, San Francisco 94133, California USA");
                        put("document_number", "4389237");
                        put("business_name", "Twilio");
                        put("issue_date", "2020-12-05");
                    }
                })
                .create();

        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.CreateSupportingDocumentParams{}
	params.SetFriendlyName("TwilioBusinessRegistration")
	params.SetType("business_registration")
	params.SetAttributes(map[string]interface{}{
		"registered_seat_of_business": "375 Beale St, San Francisco 94133, California USA",
		"document_number":             "4389237",
		"business_name":               "Twilio",
		"issue_date":                  "2020-12-05",
	})

	resp, err := client.NumbersV2.CreateSupportingDocument(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->create(
    "TwilioBusinessRegistration", // FriendlyName
    "business_registration", // Type
    [
        "attributes" => [
            "registered_seat_of_business" =>
                "375 Beale St, San Francisco 94133, California USA",
            "document_number" => "4389237",
            "business_name" => "Twilio",
            "issue_date" => "2020-12-05",
        ],
    ]
);

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
                      .create(
                        friendly_name: 'TwilioBusinessRegistration',
                        type: 'business_registration',
                        attributes: {
                          'registered_seat_of_business' => '375 Beale St, San Francisco 94133, California USA',
                          'document_number' => '4389237',
                          'business_name' => 'Twilio',
                          'issue_date' => '2020-12-05'
                        }
                      )

puts supporting_document.sid
```

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

twilio api:numbers:v2:regulatory-compliance:supporting-documents:create \
   --friendly-name TwilioBusinessRegistration \
   --type business_registration \
   --attributes "{\"registered_seat_of_business\":\"375 Beale St, San Francisco 94133, California USA\",\"document_number\":\"4389237\",\"business_name\":\"Twilio\",\"issue_date\":\"2020-12-05\"}"
```

```bash
ATTRIBUTES_OBJ=$(cat << EOF
{
  "registered_seat_of_business": "375 Beale St, San Francisco 94133, California USA",
  "document_number": "4389237",
  "business_name": "Twilio",
  "issue_date": "2020-12-05"
}
EOF
)
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments" \
--data-urlencode "FriendlyName=TwilioBusinessRegistration" \
--data-urlencode "Type=business_registration" \
--data-urlencode "Attributes=$ATTRIBUTES_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "TwilioBusinessRegistration",
  "mime_type": "mime_type",
  "status": "draft",
  "failure_reason": null,
  "errors": null,
  "type": "business_registration",
  "attributes": {
    "registered_seat_of_business": "375 Beale St, San Francisco 94133, California USA",
    "document_number": "4389237",
    "business_name": "Twilio",
    "issue_date": "2020-12-05"
  },
  "date_created": "2019-07-31T02:11:52Z",
  "date_updated": "2019-07-31T02:11:52Z",
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

### Create a new Supporting Document with file upload \[#file-upload]

Some regulations require a Supporting Document to upload proof. Proof for Twilio is the actual document that you would present during an in-person transaction.

The file upload has the same request parameters as the `Supporting Document` create, but with two significant differences: the base URI should be `https://numbers-upload.twilio.com` and you'll need to change *--data-urlencode* to `-F` as shown in the example.

Create a Supporting Document with a file upload

```bash
ATTRIBUTES=$(cat << EOF
{
    "address_sids": ["ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],
    "document_number": "312454", 
    "business_name": "Twilio",
    "issue_date": "2019-11-15"
}
EOF
)

curl -X POST https://numbers-upload.twilio.com/v2/RegulatoryCompliance/SupportingDocuments \
-F "Attributes=$ATTRIBUTES" \
-F "FriendlyName=Twilio GmbH" \
-F "Type=business_registration" \
-F "File=@twilio_business_registration.png" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
```

```json
{
    "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "attributes": {
        "business_name": "Twilio",
        "document_number": "312454",
        "issue_date": "2019-11-15",
        "registered_seat_of_business": "San Francisco, CA, USA"
    },
    "date_created": "2019-10-17T17:06:47Z",
    "date_updated": "2019-10-17T17:06:47Z",
    "friendly_name": "Twilio GmbH",
    "mime_type": "image/png",
    "sid": "RDd6340f49f352d06b77e7017d93591483",
    "status": "draft",
    "type": "business_registration",
    "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Documents/RDd6340f49f352d06b77e7017d93591483"
}
```

## Create an Item Assignment of a Bundle \[#item-assignment-create]

Once you have created all the various End-User, Supporting Documents, and Addresses, the next step is to `Assign Items` to the `Regulatory Bundle`.

### Path parameters

```json
[{"name":"BundleSid","in":"path","description":"The unique string that we created to identify the Bundle resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BU[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateItemAssignmentRequest","required":["ObjectSid"],"properties":{"ObjectSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^[a-zA-Z]{2}[0-9a-fA-F]{32}$","description":"The SID of an object bag that holds information of the different items."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"ObjectSid\": \"ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","meta":"","code":"{\n  \"ObjectSid\": \"ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"ObjectSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Assign Items to a Regulatory Bundle

```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 createItemAssignment() {
  const itemAssignment = await client.numbers.v2.regulatoryCompliance
    .bundles("BUe6c04e6a1a6133a9d3d2314e38f51dfb")
    .itemAssignments.create({
      objectSid: "RD70f07ace005177cbfee907bc9c1acabd",
    });

  console.log(itemAssignment.bundleSid);
}

createItemAssignment();
```

```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_assignment = client.numbers.v2.regulatory_compliance.bundles(
    "BUe6c04e6a1a6133a9d3d2314e38f51dfb"
).item_assignments.create(object_sid="RD70f07ace005177cbfee907bc9c1acabd")

print(item_assignment.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.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 itemAssignment = await ItemAssignmentResource.CreateAsync(
            objectSid: "RD70f07ace005177cbfee907bc9c1acabd",
            pathBundleSid: "BUe6c04e6a1a6133a9d3d2314e38f51dfb");

        Console.WriteLine(itemAssignment.BundleSid);
    }
}
```

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

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);
        ItemAssignment itemAssignment =
            ItemAssignment.creator("BUe6c04e6a1a6133a9d3d2314e38f51dfb", "RD70f07ace005177cbfee907bc9c1acabd").create();

        System.out.println(itemAssignment.getBundleSid());
    }
}
```

```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.CreateItemAssignmentParams{}
	params.SetObjectSid("RD70f07ace005177cbfee907bc9c1acabd")

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

```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);

$item_assignment = $twilio->numbers->v2->regulatoryCompliance
    ->bundles("BUe6c04e6a1a6133a9d3d2314e38f51dfb")
    ->itemAssignments->create(
        "RD70f07ace005177cbfee907bc9c1acabd" // ObjectSid
    );

print $item_assignment->bundleSid;
```

```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_assignment = @client
                  .numbers
                  .v2
                  .regulatory_compliance
                  .bundles('BUe6c04e6a1a6133a9d3d2314e38f51dfb')
                  .item_assignments
                  .create(object_sid: 'RD70f07ace005177cbfee907bc9c1acabd')

puts item_assignment.bundle_sid
```

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

twilio api:numbers:v2:regulatory-compliance:bundles:item-assignments:create \
   --bundle-sid BUe6c04e6a1a6133a9d3d2314e38f51dfb \
   --object-sid RD70f07ace005177cbfee907bc9c1acabd
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUe6c04e6a1a6133a9d3d2314e38f51dfb/ItemAssignments" \
--data-urlencode "ObjectSid=RD70f07ace005177cbfee907bc9c1acabd" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "bundle_sid": "BUe6c04e6a1a6133a9d3d2314e38f51dfb",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "object_sid": "RD70f07ace005177cbfee907bc9c1acabd",
  "date_created": "2019-07-31T02:34:41Z",
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Submit Regulatory Bundle \[#submit-bundle]

Once you've succeeded in *Assigning* all the required *Items* to the `Regulatory Bundle`, the final step is to submit the `Regulatory Bundle` for review. The status of the `Regulatory Bundle` will transition to `pending-review`.

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The unique string that we created to identify the Bundle resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BU[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateBundleRequest","properties":{"Status":{"type":"string","enum":["draft","pending-review","in-review","twilio-rejected","twilio-approved","provisionally-approved"],"description":"The verification status of the Bundle resource.","refName":"bundle_enum_status","modelName":"bundle_enum_status"},"StatusCallback":{"type":"string","format":"uri","description":"The URL we call to inform your application of status changes."},"FriendlyName":{"type":"string","description":"The string that you assigned to describe the resource."},"Email":{"type":"string","description":"The email address that will receive updates when the Bundle resource changes status."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"Status\": \"draft\",\n  \"StatusCallback\": \"http://www.example.com\",\n  \"FriendlyName\": \"friendly_name\",\n  \"Email\": \"email\"\n}","meta":"","code":"{\n  \"Status\": \"draft\",\n  \"StatusCallback\": \"http://www.example.com\",\n  \"FriendlyName\": \"friendly_name\",\n  \"Email\": \"email\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Status\"","#7EE787"],[":","#C9D1D9"]," ",["\"draft\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"StatusCallback\"","#7EE787"],[":","#C9D1D9"]," ",["\"http://www.example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Email\"","#7EE787"],[":","#C9D1D9"]," ",["\"email\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Submit Regulatory Bundle

```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("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .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(
    "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).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: "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        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("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		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("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->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('BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
         .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 BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --status pending-review
```

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

```json
{
  "sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "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"
  }
}
```
