Get Document Indexing Task
Returns one indexing task of a document, with its progress. Poll it until state is succeeded, failed, canceled, or superseded.
For a task started by Re-index Documents, poll Get Indexing Task with compilation_job.id instead.
For which task operation to use when, see Track Indexing.
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_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{
"active_operations": [
"chunk",
"fts_index",
"embedding"
],
"completed_at": null,
"created_at": "2026-10-20T08:15:42Z",
"document_id": "2f6b8d1a-7c3e-4a5b-9d0e-1f2a3b4c5d6e",
"document_revision": 2,
"error_code": null,
"error_message": null,
"failure": null,
"id": "c4e8a2f6-1b3d-4e5f-8a9b-0c1d2e3f4a5b",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"phase": "chunking_indexing",
"progress_percent": 35,
"retry_at": null,
"semantic_enrichment": {
"error_code": null,
"error_message": null,
"failure": null,
"nodes_completed": 0,
"nodes_total": null,
"provider_calls": null,
"provider_calls_maximum": null,
"state": "not_scheduled",
"updated_at": null
},
"stage": "outline_built",
"state": "running",
"updated_at": "2026-10-20T08:15:58Z"
}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.
Indexing task ID: latest_task.id from Get Document or List Documents, or id from List Document Indexing Tasks. The task must belong to this document.
Response
The indexing task.
Operations under way in the current phase, such as parse, chunk, embedding, or publication.
When the task ended, ISO 8601. null while it runs.
When the task was created, ISO 8601. Get Indexing Task reports the same task's times in epoch milliseconds.
Document ID.
Revision this task builds.
Error code when state is failed.
The message for error_code. Can differ from failure.message.
Error details when state is failed. stage is the phase the task failed in, and traceId is the task ID. null otherwise.
Show child attributes
Show child attributes
Indexing task ID. The same ID works with Get Indexing Task, Cancel Indexing Task, and Retry Indexing Task.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
What the task is doing: queued, parsing, outline_summary, chunking_indexing, graph_admission, publication, or complete.
Progress from 0 to 100, derived from stage.
When the automatic retry runs, ISO 8601. Set while state is retry_wait.
Knowledge graph building after the revision publishes. Indexing finishes the knowledge graph before publishing, so it doesn't schedule this step. state is not_scheduled while the task runs and disabled once it has ended. nodes_completed stays 0.
Show child attributes
Show child attributes
Last checkpoint reached, in forward order: queued, parsed, outline_built, nodes_generated, projection_built, smoke_eval_passed, published. It stays at the last checkpoint when the task fails or is canceled, so read state for the outcome.
Run state:
dispatch_pending,queued: waiting for a worker.retry_wait: an automatic retry is scheduled atretry_at.running: a worker is indexing.succeeded: the revision is published and serves queries.failed: seefailure. Restart it with Retry Indexing Task.canceled.superseded: a newer attempt replaced this one.
succeeded, failed, canceled, and superseded are terminal.
When the task last changed, ISO 8601.
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_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}/logical-documents/{document_id}/processing-tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_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{
"active_operations": [
"chunk",
"fts_index",
"embedding"
],
"completed_at": null,
"created_at": "2026-10-20T08:15:42Z",
"document_id": "2f6b8d1a-7c3e-4a5b-9d0e-1f2a3b4c5d6e",
"document_revision": 2,
"error_code": null,
"error_message": null,
"failure": null,
"id": "c4e8a2f6-1b3d-4e5f-8a9b-0c1d2e3f4a5b",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"phase": "chunking_indexing",
"progress_percent": 35,
"retry_at": null,
"semantic_enrichment": {
"error_code": null,
"error_message": null,
"failure": null,
"nodes_completed": 0,
"nodes_total": null,
"provider_calls": null,
"provider_calls_maximum": null,
"state": "not_scheduled",
"updated_at": null
},
"stage": "outline_built",
"state": "running",
"updated_at": "2026-10-20T08:15:58Z"
}