Skip to contentSkip to navigationSkip to topbar
On this page

Policies Resource



Policy Properties

policy-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<RN>Optional
Not PII

The unique string that identifies the Policy resource.

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

friendly_namestringOptional

A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy


requirementsobjectOptional

The SID of an object that holds the policy information


urlstring<uri>Optional

The absolute URL of the Policy resource.


Fetch specific Policy Instance.

fetch-specific-policy-instance page anchor
GET https://trusthub.twilio.com/v1/Policies/{Sid}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
SidSID<RN>required

The unique string that identifies the Policy resource.

Pattern: ^RN[0-9a-fA-F]{32}$Min length: 34Max length: 34
Fetch a PolicyLink to code sample: Fetch a Policy
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 fetchPolicies() {
11
const policy = await client.trusthub.v1
12
.policies("RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(policy.sid);
16
}
17
18
fetchPolicies();

Output

1
{
2
"url": "https://trusthub.twilio.com/v1/Policies/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"requirements": {
4
"end_user": [
5
{
6
"url": "/EndUserTypes/customer_profile_business_information",
7
"fields": [
8
"business_type",
9
"business_registration_number",
10
"business_name",
11
"business_registration_identifier",
12
"business_identity",
13
"business_industry",
14
"website_url",
15
"business_regions_of_operation",
16
"social_media_profile_urls"
17
],
18
"type": "customer_profile_business_information",
19
"name": "Business Information",
20
"requirement_name": "customer_profile_business_information"
21
},
22
{
23
"url": "/EndUserTypes/authorized_representative_1",
24
"fields": [
25
"first_name",
26
"last_name",
27
"email",
28
"phone_number",
29
"business_title",
30
"job_position"
31
],
32
"type": "authorized_representative_1",
33
"name": "Authorized Representative 1",
34
"requirement_name": "authorized_representative_1"
35
},
36
{
37
"url": "/EndUserTypes/authorized_representative_2",
38
"fields": [
39
"first_name",
40
"last_name",
41
"email",
42
"phone_number",
43
"business_title",
44
"job_position"
45
],
46
"type": "authorized_representative_2",
47
"name": "Authorized Representative 2",
48
"requirement_name": "authorized_representative_2"
49
}
50
],
51
"supporting_trust_products": [],
52
"supporting_document": [
53
[
54
{
55
"description": "Customer Profile HQ Physical Address",
56
"type": "document",
57
"name": "Physical Business Address",
58
"accepted_documents": [
59
{
60
"url": "/SupportingDocumentTypes/customer_profile_address",
61
"fields": [
62
"address_sids"
63
],
64
"type": "customer_profile_address",
65
"name": "Physical Business Address"
66
}
67
],
68
"requirement_name": "customer_profile_address"
69
}
70
]
71
],
72
"supporting_customer_profiles": []
73
},
74
"friendly_name": "Primary Customer Profile of type Business",
75
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
76
}

Retrieve a list of all Policys.

retrieve-a-list-of-all-policys page anchor
GET https://trusthub.twilio.com/v1/Policies

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 listPolicies() {
11
const policies = await client.trusthub.v1.policies.list({ limit: 20 });
12
13
policies.forEach((p) => console.log(p.sid));
14
}
15
16
listPolicies();

Output

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

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.