# Bundle Clones Resource

With the Bundle Clone resource, developers can reuse compliance information across Twilio accounts. The resource creates a copy of a `twilio-approved` regulatory bundle against another account within the same organization. The new regulatory bundle is automatically set to the `twilio-approved` status, enabling you to start provisioning phone numbers in the new account immediately.

## Clone Properties

```json
{"type":"object","refName":"numbers.v2.bundle_clone","modelName":"numbers_v2_bundle_clone","properties":{"bundle_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BU[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string that we created to identify the Bundle resource."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Account](/docs/iam/api/account) that created the Bundle resource."},"regulation_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^RN[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string of a regulation that is associated to the Bundle resource."},"friendly_name":{"type":"string","nullable":true,"description":"The string that you assigned to describe the resource."},"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_clone_enum_status","modelName":"bundle_clone_enum_status"},"valid_until":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until."},"email":{"type":"string","nullable":true,"description":"The email address that will receive updates when the Bundle resource changes status."},"status_callback":{"type":"string","format":"uri","nullable":true,"description":"The URL we call to inform your application of status changes."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## Creates a new clone of the Bundle in target Account. It will internally create clones of all the bundle items (identities and documents) of the original bundle

`POST https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/{BundleSid}/Clones`

### Path parameters

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

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateBundleCloneRequest","required":["TargetAccountSid"],"properties":{"TargetAccountSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","description":"The SID of the [Account](/docs/iam/api/account) where the bundle needs to be cloned."},"MoveToDraft":{"type":"boolean","description":"If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved"},"FriendlyName":{"type":"string","description":"The string that you assigned to describe the cloned bundle."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"TargetAccountSid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"\n}","meta":"","code":"{\n  \"FriendlyName\": \"friendly_name\",\n  \"TargetAccountSid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"friendly_name\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"TargetAccountSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Below is an example of creating a new Bundle Clone resource. The response from Twilio contains a JSON body with the [created Bundle Clone's properties](#clone-properties).

Create new Bundle Clone

```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 createBundleClone() {
  const bundleClone = await client.numbers.v2
    .bundleClone("BUef3a237936fb63163fd852d77c5ba27b")
    .create({
      friendlyName: "friendlyName",
      targetAccountSid: "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
    });

  console.log(bundleClone.bundleSid);
}

createBundleClone();
```

```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_clone = client.numbers.v2.bundle_clone(
    "BUef3a237936fb63163fd852d77c5ba27b"
).create(
    target_account_sid="ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
    friendly_name="friendlyName",
)

print(bundle_clone.bundle_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Numbers.V2;
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 bundleClone = await BundleCloneResource.CreateAsync(
            targetAccountSid: "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
            friendlyName: "friendlyName",
            pathBundleSid: "BUef3a237936fb63163fd852d77c5ba27b");

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

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

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.BundleClone;

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);
        BundleClone bundleClone =
            BundleClone.creator("BUef3a237936fb63163fd852d77c5ba27b", "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab")
                .setFriendlyName("friendlyName")
                .create();

        System.out.println(bundleClone.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.CreateBundleCloneParams{}
	params.SetTargetAccountSid("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab")
	params.SetFriendlyName("friendlyName")

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

$bundle_clone = $twilio->numbers->v2
    ->bundleClone("BUef3a237936fb63163fd852d77c5ba27b")
    ->create(
        "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab", // TargetAccountSid
        ["friendlyName" => "friendlyName"]
    );

print $bundle_clone->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)

bundle_clone = @client
               .numbers
               .v2
               .bundle_clone('BUef3a237936fb63163fd852d77c5ba27b')
               .create(
                 target_account_sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab',
                 friendly_name: 'friendlyName'
               )

puts bundle_clone.bundle_sid
```

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

twilio api:numbers:v2:regulatory-compliance:bundles:clones:update \
   --bundle-sid BUef3a237936fb63163fd852d77c5ba27b \
   --target-account-sid ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab \
   --friendly-name friendlyName
```

```bash
curl -X POST "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUef3a237936fb63163fd852d77c5ba27b/Clones" \
--data-urlencode "TargetAccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" \
--data-urlencode "FriendlyName=friendlyName" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "bundle_sid": "BUef3a237936fb63163fd852d77c5ba27b",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
  "regulation_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "friendly_name": "friendlyName",
  "status": "twilio-approved",
  "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",
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab/Clones"
}
```

### Bundle Statuses

The following statuses encompass the Bundle lifecycle.

| **Status**      | **Description**                                                                                                                                                     |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| draft           | The user has created a new Bundle that can be edited with Supporting Documents and End-User objects assigned.                                                       |
| pending-review  | When the user has finished the draft of the Bundle and submits to Twilio for `review`, the status moves from draft to `pending-review`.                             |
| in-review       | Twilio has moved the Bundle from pending-review to in-review. Once Twilio has finished review, the Bundle will go either to `twilio-approved` or `twilio-rejected`. |
| twilio-rejected | Twilio has reviewed the Bundle and has determined the Bundle does not meet the regulations.                                                                         |
| twilio-approved | Twilio has reviewed the Bundle and has determined the Bundles does meet the regulations.                                                                            |
