Get Chunk
Returns one chunk of one revision of a document. Takes the document ID from List Documents, not the document file ID, plus the revision number and the chunk ID.
The chunk must belong to that revision.
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2026-09-03T10:04:30Z",
"document_id": "3d2f1c0b-9a8e-4d7c-b6a5-4f3e2d1c0b9a",
"document_revision": 2,
"enabled": true,
"end_offset": 5120,
"id": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
"kind": "chunk",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"ordinal": 14,
"parent_chunk_id": null,
"parse_element_ids": [
"el-40",
"el-41"
],
"section_path": [
"3 Employment",
"3.4 Termination"
],
"start_offset": 4600,
"text": "Either party may terminate this agreement with thirty days' written notice.",
"token_count": 131,
"user_metadata": {}
}Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Path Parameters
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.
The document ID, from List Documents or from the address bar of the open document (/datasets/new/<knowledge base ID>/documents/<document ID>).
Revision number. From List Document Revisions.
x >= 1Chunk ID. From List Chunks.
Response
The chunk.
Offsets refer to the parsed document text. They are not positions in the original file.
When the chunk was created, ISO 8601.
Document ID: the id of Get Document.
Revision the chunk belongs to. Each revision has its own chunks. A chunk ID is addressable only through its own revision.
Whether the chunk takes part in retrieval. No operation in this API changes it.
Zero-based UTF-8 byte offset in the parsed document text. Exclusive end. null when unknown.
What the chunk was built from: chunk for a run of body text (the default), section for a heading section, table for a table, image for an image, summary for a generated summary.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
Position of the chunk within the revision, starting at 0. Sort by it to read chunks in document order.
ID of the parent chunk for parent-child chunking. null for top-level chunks.
IDs of the parsed elements the chunk was built from.
Headings from the document root to the chunk's section.
Zero-based UTF-8 byte offset in the parsed document text. Inclusive start. null when unknown.
Chunk content.
Number of tokens in text.
Metadata attached to the chunk. Free-form object.
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2026-09-03T10:04:30Z",
"document_id": "3d2f1c0b-9a8e-4d7c-b6a5-4f3e2d1c0b9a",
"document_revision": 2,
"enabled": true,
"end_offset": 5120,
"id": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
"kind": "chunk",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"ordinal": 14,
"parent_chunk_id": null,
"parse_element_ids": [
"el-40",
"el-41"
],
"section_path": [
"3 Employment",
"3.4 Termination"
],
"start_offset": 4600,
"text": "Either party may terminate this agreement with thirty days' written notice.",
"token_count": 131,
"user_metadata": {}
}