Skip to contentSkip to navigationSkip to topbar
On this page

Policies Resource



Policy Properties

policy-properties page anchor
Property nameTypeRequiredDescriptionChild properties
idstring

Optional

Not PII

The Policy ID.

Pattern: ^aia_plcy_*$

namestring

Optional

The name of the policy.


descriptionstring

Optional

The description of the policy.


account_sidSID<AC>

Optional

The SID of the Account that created the Policy resource.

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

user_sidSID<US>

Optional

The SID of the User that created the Policy resource.

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

typestringrequired

The type of the policy.


policy_detailsobjectrequired

The details of the policy based on the type.


date_updatedstring<date-time>

Optional

The date and time in GMT when the Policy was last updated specified in ISO 8601(link takes you to an external page) format.


GET https://assistants.twilio.com/v1/Policies

Query parameters

query-parameters page anchor
Property nameTypeRequiredPIIDescription
ToolIdstring

Optional

The tool ID.


KnowledgeIdstring

Optional

The knowledge ID.


Pageinteger

Optional

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

Minimum: 0

PageSizeinteger

Optional

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

Minimum: 1Maximum: 1000

PageTokenstring

Optional

The page token. This is provided by the API.

List multiple PolicysLink to code sample: List multiple Policys
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.assistants.v1.policies.list({ limit: 20 });
12
13
policies.forEach((p) => console.log(p.id));
14
}
15
16
listPolicies();

Output

1
{
2
"meta": {
3
"first_page_url": "https://www.example.com",
4
"key": "key",
5
"next_page_url": "https://www.example.com",
6
"page": 42,
7
"page_size": 42,
8
"previous_page_url": "https://www.example.com",
9
"url": "https://www.example.com"
10
},
11
"policies": [
12
{
13
"id": "aia_plcy",
14
"name": "name",
15
"description": "description",
16
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
18
"type": "type",
19
"policy_details": {},
20
"date_created": "2009-07-06T20:30:00Z",
21
"date_updated": "2009-07-06T20:30:00Z"
22
}
23
]
24
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.