Skip to contentSkip to navigationSkip to topbar
On this page

Supporting Documents Resource


(warning)

Warning

The v2 Regulatory Compliance APIs are currently in Public Beta. No breaking changes in the API contract will occur when the API moves from Public Beta to GA.

The Supporting Documents resource of Twilio's Regulatory Compliance APIs allows you to create new Supporting Documents with metadata to fulfill Regulations. Each Supporting Document Type may need different information to be compliant, so be sure to pass all of the correct values when creating a new Supporting Document Type.

A collection of Supporting Documents Assigned as Items to a Regulatory Bundle along with an End-User satisfies a Regulation(link takes you to an external page).


Supporting Documents Response Properties

supporting-documents-response-properties page anchor

The field of the Supporting Documents resource responds is in JSON. The type SID<RD> is a unique ID starting with letters RD that reference a unique Supporting Document instance. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.

Property nameTypeRequiredDescriptionChild properties
sidSID<RD>Optional
Not PII

The unique string created by Twilio to identify the Supporting Document resource.

Pattern: ^RD[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>Optional

The SID of the Account that created the Document resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestringOptional

The string that you assigned to describe the resource.


mime_typestringOptional

The image type uploaded in the Supporting Document container.


statusenum<string>Optional

The verification status of the Supporting Document resource.

Possible values:
draftpending-reviewrejectedapprovedexpiredprovisionally-approved

failure_reasonstringOptional

The failure reason of the Supporting Document Resource.


errorsarrayOptional

A list of errors that occurred during the registering RC Bundle


typestringOptional

The type of the Supporting Document.


attributesobjectOptional
PII MTL: 30 days

The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types.


date_createdstring<date-time>Optional

The date and time in GMT when the resource was created specified in ISO 8601(link takes you to an external page) format.


date_updatedstring<date-time>Optional

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


urlstring<uri>Optional

The absolute URL of the Supporting Document resource.

Supporting Document Statuses

supporting-document-statuses page anchor

The following statuses encompass the Bundle lifecycle.

StatusDescription
draftThe draft status of the Supporting Document allows users to edit the Supporting Document file and metadata.
pending-reviewWhen the user has finished the draft and submits the Supporting Document for review, the status moves from draft to pending-review, awaiting Twilio's.
rejectedTwilio has reviewed the Supporting Document and has determined the Supporting Document does not comply with the regulations.
approvedTwilio has reviewed the Supporting Document and has determined the Supporting Document does not comply with the regulations.
expiredThe document has expired and is no longer valid to provision phone numbers. An updated document must be created and added to a new or existing Bundle.

Create a Supporting Document

create-a-supporting-document page anchor
POST https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments

To provision or port in a phone number to Twilio, you will need to create one or many Supporting Documents that also may need an image as proof.

A Supporting Document is a container that holds metadata of a legal document. Each Supporting Document Type requires a different value during the create operation.

The Regulation may need the End-User to upload an image as proof for the Supporting Document. Formats accepted are JPEG, PNG, and PDF, with a file size limit of 5 MB.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

The string that you assigned to describe the resource.


Typestringrequired

The type of the Supporting Document.


AttributesobjectOptional

The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.

Create a Supporting DocumentLink to code sample: Create a Supporting Document
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createSupportingDocument() {
11
const supportingDocument =
12
await client.numbers.v2.regulatoryCompliance.supportingDocuments.create({
13
attributes: {
14
address_sids: [
15
"ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
16
"ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
17
],
18
},
19
friendlyName: "BusinessRegistration",
20
type: "business_registration",
21
});
22
23
console.log(supportingDocument.sid);
24
}
25
26
createSupportingDocument();

Output

1
{
2
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "BusinessRegistration",
5
"mime_type": "mime_type",
6
"status": "draft",
7
"failure_reason": null,
8
"errors": null,
9
"type": "business_registration",
10
"attributes": {
11
"first_name": "foo",
12
"last_name": "bar"
13
},
14
"date_created": "2019-07-31T02:11:52Z",
15
"date_updated": "2019-07-31T02:11:52Z",
16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
}
Create a Supporting Document and upload a fileLink to code sample: Create a Supporting Document and upload a file
1
ATTRIBUTES=$(cat << EOF
2
{
3
"address_sids": ["ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],
4
"document_number": "312454",
5
"business_name": "Twilio",
6
"issue_date": "2019-11-15"
7
}
8
EOF
9
)
10
11
curl -X POST https://numbers-upload.twilio.com/v2/RegulatoryCompliance/SupportingDocuments \
12
-F "Attributes=$ATTRIBUTES" \
13
-F "FriendlyName=Twilio GmbH" \
14
-F "Type=business_registration" \
15
-F "File=@twilio_business_registration.png" \
16
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

Output

1
{
2
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"attributes": {
4
"business_name": "Twilio",
5
"document_number": "312454",
6
"issue_date": "2019-11-15",
7
"registered_seat_of_business": "San Francisco, CA, USA"
8
},
9
"date_created": "2019-10-17T17:06:47Z",
10
"date_updated": "2019-10-17T17:06:47Z",
11
"friendly_name": "Twilio GmbH",
12
"mime_type": "image/png",
13
"sid": "RDd6340f49f352d06b77e7017d93591483",
14
"status": "draft",
15
"type": "business_registration",
16
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Documents/RDd6340f49f352d06b77e7017d93591483"
17
}

Fetch a Supporting Document instance

fetch-a-supporting-document-instance page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<RD>required

The unique string created by Twilio to identify the Supporting Document resource.

Pattern: ^RD[0-9a-fA-F]{32}$Min length: 34Max length: 34
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchSupportingDocument() {
11
const supportingDocument = await client.numbers.v2.regulatoryCompliance
12
.supportingDocuments("RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(supportingDocument.sid);
16
}
17
18
fetchSupportingDocument();

Output

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

Retrieve a list of Supporting Documents

retrieve-a-list-of-supporting-documents page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSupportingDocument() {
11
const supportingDocuments =
12
await client.numbers.v2.regulatoryCompliance.supportingDocuments.list({
13
limit: 20,
14
});
15
16
supportingDocuments.forEach((s) => console.log(s.sid));
17
}
18
19
listSupportingDocument();

Output

1
{
2
"results": [],
3
"meta": {
4
"page": 0,
5
"page_size": 50,
6
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
7
"previous_page_url": null,
8
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments?PageSize=50&Page=0",
9
"next_page_url": null,
10
"key": "results"
11
}
12
}

Update a Supporting Document Instance

update-a-supporting-document-instance page anchor
POST https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<RD>required

The unique string created by Twilio to identify the Supporting Document resource.

Pattern: ^RD[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringOptional

The string that you assigned to describe the resource.


AttributesobjectOptional

The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateSupportingDocument() {
11
const supportingDocument = await client.numbers.v2.regulatoryCompliance
12
.supportingDocuments("RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({ friendlyName: "My new Friendly Name" });
14
15
console.log(supportingDocument.sid);
16
}
17
18
updateSupportingDocument();

Output

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

Delete a Supporting Document instance

delete-a-supporting-document-instance page anchor
DELETE https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/{Sid}

The DELETE operation is allowed for Supporting Documents with status of DRAFT, APPROVED, or REJECTED and have no active Long Code phone number assignments.

Property nameTypeRequiredPIIDescription
SidSID<RD>required

The unique string created by Twilio to identify the Supporting Document resource.

Pattern: ^RD[0-9a-fA-F]{32}$Min length: 34Max length: 34
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteSupportingDocument() {
11
await client.numbers.v2.regulatoryCompliance
12
.supportingDocuments("RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.remove();
14
}
15
16
deleteSupportingDocument();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.