When you create a Knowledge source, Twilio AI Assistants processes that Knowledge and breaks it into discrete pieces called Chunks. These pieces can help you troubleshoot unexpected behavior with your Assistant.
This API returns a list of all Knowledge Chunks created from uploading Knowledge sources.
GET https://assistants.twilio.com/v1/Knowledge/{id}/Chunks
The knowledge ID.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listKnowledgeChunks() {11const chunks = await client.assistants.v112.knowledge("aia_know")13.chunks.list({ limit: 20 });1415chunks.forEach((c) => console.log(c.accountSid));16}1718listKnowledgeChunks();
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}