Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Agent Copilot: Knowledge chunk resource (public beta)


(new)

Public Beta

Agent Copilot is currently available as a Public Beta product and the information contained in this document is subject to change. This means that some features are not yet implemented and others may be changed before the product is declared as Generally Available. Public Beta products are not covered by a SLA.

(warning)

Not a HIPAA Eligible Service or PCI Compliant

Agent Copilot is not a HIPAA Eligible Service or PCI compliant and should not be used in Flex workflows that are subject to HIPAA or PCI. However, we offer mitigation tools such as PII redaction. To learn more, see AI data use.

When you create a Knowledge source, Agent Copilot processes that Knowledge and breaks it into discrete pieces called chunks. These pieces can help you troubleshoot unexpected behavior with Agent Copilot.

This API returns a list of all Knowledge chunks created from uploading Knowledge sources.


Chunk properties

chunk-properties page anchor
Property nameTypeRequiredPIIDescriptionChild properties
accountSidSID<AC>

Optional

Not PII

The SID of the Account that created the Knowledge resource.

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

contentstring

Optional

The chunk content.


metadataobject

Optional

The metadata of the chunk.


dateUpdatedstring<date-time>

Optional

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


GET https://knowledge.twilio.com/v1/Knowledge/{id}/Chunks

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
idstring
required

The knowledge ID.

Property nameTypeRequiredPIIDescription
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.

Get chunks for a given Knowledge sourceLink to code sample: Get chunks for a given Knowledge source
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 listKnowledgeChunks() {
11
const chunks = await client.knowledge.v1
12
.knowledge("id")
13
.chunks.list({ limit: 20 });
14
15
chunks.forEach((c) => console.log(c.accountSid));
16
}
17
18
listKnowledgeChunks();

Response

Note about this response
1
{
2
"chunks": [
3
{
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"content": "content",
6
"metadata": {},
7
"date_created": "2009-07-06T20:30:00Z",
8
"date_updated": "2009-07-06T20:30:00Z"
9
}
10
],
11
"meta": {
12
"first_page_url": "https://www.example.com",
13
"key": "key",
14
"next_page_url": "https://www.example.com",
15
"page": 42,
16
"page_size": 42,
17
"previous_page_url": "https://www.example.com",
18
"url": "https://www.example.com"
19
}
20
}