# Supporting Document Types Resource

> \[!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](/docs/phone-numbers/regulatory/api/supporting-documents) with the correct type and values.

Each [Supporting Document Type](/docs/phone-numbers/regulatory/api/supporting-document-types) may need different information to be compliant. Supporting Documents [Assigned as Items](/docs/phone-numbers/regulatory/api/item-assignments) to a [Regulatory Bundle](/docs/phone-numbers/regulatory/api/bundles) along with an [End-User](/docs/phone-numbers/regulatory/api/end-users) satisfy a [Regulation](https://www.twilio.com/en-us/guidelines/regulatory).

## Supporting Document Types Response Properties

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](/docs/glossary/what-is-a-sid).

```json
{"type":"object","refName":"numbers.v2.regulatory_compliance.supporting_document_type","modelName":"numbers_v2_regulatory_compliance_supporting_document_type","properties":{"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^OY[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string that identifies the Supporting Document Type resource."},"friendly_name":{"type":"string","nullable":true,"description":"A human-readable description of the Supporting Document Type resource."},"machine_name":{"type":"string","nullable":true,"description":"The machine-readable description of the Supporting Document Type resource."},"fields":{"type":"array","nullable":true,"description":"The required information for creating a Supporting Document. The required fields will change as regulatory needs change and will differ for businesses and individuals."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the Supporting Document Type resource."}}}
```

## Retrieve a list of Supporting Document Types

`GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/{Sid}`

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The unique string that identifies the Supporting Document Type resource.","schema":{"type":"string"},"required":true}]
```

Retrieve a list of Supporting Document Types

```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 listSupportingDocumentType() {
  const supportingDocumentTypes =
    await client.numbers.v2.regulatoryCompliance.supportingDocumentTypes.list({
      limit: 20,
    });

  supportingDocumentTypes.forEach((s) => console.log(s.sid));
}

listSupportingDocumentType();
```

```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_types = (
    client.numbers.v2.regulatory_compliance.supporting_document_types.list(
        limit=20
    )
)

for record in supporting_document_types:
    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 supportingDocumentTypes = await SupportingDocumentTypeResource.ReadAsync(limit: 20);

        foreach (var record in supportingDocumentTypes) {
            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.SupportingDocumentType;
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<SupportingDocumentType> supportingDocumentTypes = SupportingDocumentType.reader().limit(20).read();

        for (SupportingDocumentType record : supportingDocumentTypes) {
            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.ListSupportingDocumentTypeParams{}
	params.SetLimit(20)

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

$supportingDocumentTypes = $twilio->numbers->v2->regulatoryCompliance->supportingDocumentTypes->read(
    20
);

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

supporting_document_types = @client
                            .numbers
                            .v2
                            .regulatory_compliance
                            .supporting_document_types
                            .list(limit: 20)

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

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

twilio api:numbers:v2:regulatory-compliance:supporting-document-types:list
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "supporting_document_types": [],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "supporting_document_types"
  }
}
```

## Read a Supporting Document Type resource instance

`GET https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes`

### Query parameters

```json
[{"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 Supporting Document Type resource instance

```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 fetchSupportingDocumentType() {
  const supportingDocumentType = await client.numbers.v2.regulatoryCompliance
    .supportingDocumentTypes("Sid")
    .fetch();

  console.log(supportingDocumentType.sid);
}

fetchSupportingDocumentType();
```

```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_type = (
    client.numbers.v2.regulatory_compliance.supporting_document_types(
        "Sid"
    ).fetch()
)

print(supporting_document_type.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 supportingDocumentType =
            await SupportingDocumentTypeResource.FetchAsync(pathSid: "Sid");

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

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

import com.twilio.Twilio;
import com.twilio.rest.numbers.v2.regulatorycompliance.SupportingDocumentType;

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);
        SupportingDocumentType supportingDocumentType = SupportingDocumentType.fetcher("Sid").fetch();

        System.out.println(supportingDocumentType.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"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()

	resp, err := client.NumbersV2.FetchSupportingDocumentType("Sid")
	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_type = $twilio->numbers->v2->regulatoryCompliance
    ->supportingDocumentTypes("Sid")
    ->fetch();

print $supporting_document_type->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_type = @client
                           .numbers
                           .v2
                           .regulatory_compliance
                           .supporting_document_types('Sid')
                           .fetch

puts supporting_document_type.sid
```

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

twilio api:numbers:v2:regulatory-compliance:supporting-document-types:fetch \
   --sid Sid
```

```bash
curl -X GET "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/Sid" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "Sid",
  "friendly_name": "Passport",
  "machine_name": "passport",
  "fields": [
    {
      "friendly_name": "Last Name",
      "machine_name": "last_name",
      "constraint": "String"
    }
  ],
  "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```
