Skip to contentSkip to navigationSkip to topbar
On this page

Supporting Document Types 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 Document Type resource of Twilio's Regulatory Compliance API informs you which type of document you create and what the values are. You will then create a new Supporting Document with the correct type and values.

Each Supporting Document Type may need different information to be compliant. Supporting Documents Assigned as Items to a Regulatory Bundle along with an End-User satisfy a Regulation(link takes you to an external page).


Supporting Document Types Response Properties

supporting-document-types-response-properties page anchor

The field of the Supporting Document Types resource response is in JSON. The type SID<OY> is a unique ID starting with letters OY. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.

Property nameTypeRequiredDescriptionChild properties
sidSID<OY>Optional
Not PII

The unique string that identifies the Supporting Document Type resource.

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

friendly_namestringOptional

A human-readable description of the Supporting Document Type resource.


machine_namestringOptional

The machine-readable description of the Supporting Document Type resource.


fieldsarrayOptional

The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals.


urlstring<uri>Optional

The absolute URL of the Supporting Document Type resource.


Retrieve a list of Supporting Document Types

retrieve-a-list-of-supporting-document-types page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/{Sid}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
Sidstringrequired

The unique string that identifies the Supporting Document Type resource.

Retrieve a list of Supporting Document TypesLink to code sample: Retrieve a list of 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 listSupportingDocumentType() {
11
const supportingDocumentTypes =
12
await client.numbers.v2.regulatoryCompliance.supportingDocumentTypes.list({
13
limit: 20,
14
});
15
16
supportingDocumentTypes.forEach((s) => console.log(s.sid));
17
}
18
19
listSupportingDocumentType();

Output

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

Read a Supporting Document Type resource instance

read-a-supporting-document-type-resource-instance page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes

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.

Read a Supporting Document Type resource instanceLink to code sample: Read a Supporting Document Type resource instance
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 fetchSupportingDocumentType() {
11
const supportingDocumentType = await client.numbers.v2.regulatoryCompliance
12
.supportingDocumentTypes("Sid")
13
.fetch();
14
15
console.log(supportingDocumentType.sid);
16
}
17
18
fetchSupportingDocumentType();

Output

1
{
2
"sid": "Sid",
3
"friendly_name": "Passport",
4
"machine_name": "passport",
5
"fields": [
6
{
7
"friendly_name": "Last Name",
8
"machine_name": "last_name",
9
"constraint": "String"
10
}
11
],
12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
13
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.