Skip to contentSkip to navigationSkip to topbar
On this page

TrustProduct Resource



TrustProduct Properties

trustproduct-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<BU>

Optional

Not PII

The unique string that we created to identify the Trust Product resource.

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

account_sidSID<AC>

Optional

The SID of the Account that created the Trust Product resource.

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

policy_sidSID<RN>

Optional

The unique string of the policy that is associated with the Trust Product resource.

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

friendly_namestring

Optional

The string that you assigned to describe the resource.


statusenum<string>

Optional

The verification status of the Trust Product resource.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approved

emailstring

Optional

The email address that will receive updates when the Trust Product resource changes status.


status_callbackstring<uri>

Optional

The URL we call to inform your application of status changes.


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 Trust Product resource.


linksobject<uri-map>

Optional

The URLs of the Assigned Items of the Trust Product resource.


errorsarray

Optional

The error codes associated with the rejection of the Trust Product.


Create a TrustProduct resource

create-a-trustproduct-resource page anchor
POST https://trusthub.twilio.com/v1/TrustProducts

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

The string that you assigned to describe the resource.


Emailstringrequired

The email address that will receive updates when the Trust Product resource changes status.


PolicySidSID<RN>required

The unique string of a policy that is associated to the Trust Product resource.

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

StatusCallbackstring<uri>

Optional

The URL we call to inform your application of status changes.

Create a TrustProductLink to code sample: Create a TrustProduct
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 createTrustProduct() {
11
const trustProduct = await client.trusthub.v1.trustProducts.create({
12
email: "Email",
13
friendlyName: "FriendlyName",
14
policySid: "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(trustProduct.sid);
18
}
19
20
createTrustProduct();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "FriendlyName",
6
"status": "draft",
7
"email": "Email",
8
"status_callback": "http://www.example.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
15
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
16
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
17
},
18
"errors": null
19
}

Fetch a TrustProduct resource

fetch-a-trustproduct-resource page anchor
GET https://trusthub.twilio.com/v1/TrustProducts/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<BU>required

The unique string that we created to identify the Trust Product resource.

Pattern: ^BU[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 fetchTrustProduct() {
11
const trustProduct = await client.trusthub.v1
12
.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(trustProduct.sid);
16
}
17
18
fetchTrustProduct();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "draft",
7
"valid_until": null,
8
"email": "email",
9
"status_callback": "http://www.example.com",
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
15
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
16
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
17
},
18
"errors": [
19
{
20
"code": 18601
21
}
22
]
23
}

Read multiple TrustProduct resources

read-multiple-trustproduct-resources page anchor
GET https://trusthub.twilio.com/v1/TrustProducts

Property nameTypeRequiredPIIDescription
Statusenum<string>

Optional

The verification status of the Trust Product resource.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approved

FriendlyNamestring

Optional

The string that you assigned to describe the resource.


PolicySidSID<RN>

Optional

The unique string of a policy that is associated to the Trust Product resource.

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

PageSizeinteger

Optional

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

Minimum: 1Maximum: 1000

Pageinteger

Optional

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

Minimum: 0

PageTokenstring

Optional

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 listTrustProduct() {
11
const trustProducts = await client.trusthub.v1.trustProducts.list({
12
limit: 20,
13
});
14
15
trustProducts.forEach((t) => console.log(t.sid));
16
}
17
18
listTrustProduct();

Output

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

Update a TrustProduct resource

update-a-trustproduct-resource page anchor
POST https://trusthub.twilio.com/v1/TrustProducts/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<BU>required

The unique string that we created to identify the Trust Product resource.

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

Optional

The verification status of the Trust Product resource. If the current verification status of the Trust Product is draft, you may set the verification status to pending-review to submit the TrustProduct for Twilio review. No other values for status are permissible when updating a resource via this API endpoint as the other states are maintained by Twilio.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approved

StatusCallbackstring<uri>

Optional

The URL we call to inform your application of status changes.


FriendlyNamestring

Optional

The string that you assigned to describe the resource.


Emailstring

Optional

The email address that will receive updates when the Trust Product resource changes status.

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 updateTrustProduct() {
11
const trustProduct = await client.trusthub.v1
12
.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({ status: "draft" });
14
15
console.log(trustProduct.sid);
16
}
17
18
updateTrustProduct();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "draft",
7
"email": "email",
8
"status_callback": "http://www.example.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
15
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
16
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
17
},
18
"errors": null
19
}

Delete a TrustProduct resource

delete-a-trustproduct-resource page anchor
DELETE https://trusthub.twilio.com/v1/TrustProducts/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<BU>required

The unique string that we created to identify the Trust Product resource.

Pattern: ^BU[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 deleteTrustProduct() {
11
await client.trusthub.v1
12
.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.remove();
14
}
15
16
deleteTrustProduct();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.