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.
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.
The unique string created by Twilio to identify the Supporting Document resource.
^RD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Document resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The verification status of the Supporting Document resource.
draft
pending-review
rejected
approved
expired
provisionally-approved
The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The absolute URL of the Supporting Document resource.
The following statuses encompass the Bundle lifecycle.
Status | Description |
---|---|
draft | The draft status of the Supporting Document allows users to edit the Supporting Document file and metadata. |
pending-review | When the user has finished the draft and submits the Supporting Document for review, the status moves from draft to pending-review , awaiting Twilio's. |
rejected | Twilio has reviewed the Supporting Document and has determined the Supporting Document does not comply with the regulations. |
approved | Twilio has reviewed the Supporting Document and has determined the Supporting Document does not comply with the regulations. |
expired | The 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. |
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.
application/x-www-form-urlencoded
The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createSupportingDocument() {11const supportingDocument =12await client.numbers.v2.regulatoryCompliance.supportingDocuments.create({13attributes: {14address_sids: [15"ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",16"ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",17],18},19friendlyName: "BusinessRegistration",20type: "business_registration",21});2223console.log(supportingDocument.sid);24}2526createSupportingDocument();
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}
1ATTRIBUTES=$(cat << EOF2{3"address_sids": ["ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],4"document_number": "312454",5"business_name": "Twilio",6"issue_date": "2019-11-15"7}8EOF9)1011curl -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
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}
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/{Sid}
The unique string created by Twilio to identify the Supporting Document resource.
^RD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchSupportingDocument() {11const supportingDocument = await client.numbers.v2.regulatoryCompliance12.supportingDocuments("RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(supportingDocument.sid);16}1718fetchSupportingDocument();
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}
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listSupportingDocument() {11const supportingDocuments =12await client.numbers.v2.regulatoryCompliance.supportingDocuments.list({13limit: 20,14});1516supportingDocuments.forEach((s) => console.log(s.sid));17}1819listSupportingDocument();
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}
POST https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/{Sid}
The unique string created by Twilio to identify the Supporting Document resource.
^RD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateSupportingDocument() {11const supportingDocument = await client.numbers.v2.regulatoryCompliance12.supportingDocuments("RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ friendlyName: "My new Friendly Name" });1415console.log(supportingDocument.sid);16}1718updateSupportingDocument();
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 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.
The unique string created by Twilio to identify the Supporting Document resource.
^RD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteSupportingDocument() {11await client.numbers.v2.regulatoryCompliance12.supportingDocuments("RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.remove();14}1516deleteSupportingDocument();