List the document's chunks
curl --request GET \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "list",
"data": [
{
"chunk_index": 1,
"text": "<string>",
"page": 2,
"start_char": 123,
"end_char": 123,
"metadata": {}
}
],
"total": 1,
"page": 2,
"limit": 50,
"has_more": true
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required."
}
}{
"error": {
"code": "LABEL_NOT_ALLOWED",
"message": "The document's sensitivity label is not one this knowledge base may decrypt"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "knowledge_base.document not found.",
"details": {
"resource": "knowledge_base.document",
"id": "vsf_unknown"
}
}
}Documents
List the document's chunks
Debug/quality review. Requires reader+. A document decrypted
under a sensitivity label outside the knowledge base’s
decryptable labels answers 403 LABEL_NOT_ALLOWED.
GET
/
v1
/
knowledge_bases
/
{knowledgeBaseId}
/
documents
/
{documentId}
/
chunks
List the document's chunks
curl --request GET \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}/chunks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "list",
"data": [
{
"chunk_index": 1,
"text": "<string>",
"page": 2,
"start_char": 123,
"end_char": 123,
"metadata": {}
}
],
"total": 1,
"page": 2,
"limit": 50,
"has_more": true
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required."
}
}{
"error": {
"code": "LABEL_NOT_ALLOWED",
"message": "The document's sensitivity label is not one this knowledge base may decrypt"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "knowledge_base.document not found.",
"details": {
"resource": "knowledge_base.document",
"id": "vsf_unknown"
}
}
}Authorizations
Path Parameters
Query Parameters
Response
Paginated chunks.
Shared list-response envelope. Array is always data. Every
element carries its own object discriminator.
Was this page helpful?