Get Deletion Job
Returns the progress of a deletion requested with Delete Document, Delete Document File, or Delete Source, or of one file in Delete Document Files in Batch. Poll it until run_state is completed or failed.
Only the API key that requested the deletion can read its job. The job stays readable after the deletion completes.
Get Document, Get Document File, or Get Source answers 404 for the deleted object from the moment the deletion is accepted. When a source is deleted with documents=keep, its documents are hidden while the job runs and come back when it completes, with source_id set to null. If the job fails, they stay hidden.
A failed deletion cannot be retried over this API.
For the deletion flow, see Delete Documents and Sources.
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_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{
"checkpoint": "completed",
"completed_at": "2026-10-20T09:00:09Z",
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "completed",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
}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.
Deletion job ID: job.id from Delete Document, Delete Document File, or Delete Source, or the job.id of an accepted file in Delete Document Files in Batch or Get Deletion Batch. Their status_url points here.
Response
The deletion job.
How far the deletion has progressed: requested (newly accepted), then quiescing, deleting_objects, deleting_derived_data, deleting_primary_data, and completed.
When the job completed, ISO 8601. null until then, and on a failed job.
When the job was accepted, ISO 8601.
The last error, or null when there is none. It is also set while run_state is retry_wait, so read run_state, not error, to tell whether the job failed.
Show child attributes
Show child attributes
Deletion job ID.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
How a source deletion treats the source's documents: cascade deletes them, keep keeps them. Ignore it on a deletion of a document file or a document.
Item counts of a multi-item deletion. Not populated by this API. Always null.
Show child attributes
Show child attributes
When the next automatic retry runs, ISO 8601. null when none is scheduled.
Scheduler state:
dispatch_pending(newly accepted),queued,running: in progress.retry_wait: an automatic retry is scheduled atretry_at.completed: everything was removed.failed: cleanup stopped, and the target stays hidden. It can't be retried.
ID of the target: the document file ID for document, the document ID for logical_document, the source ID for source.
What the job deletes: document for a document file, logical_document for a whole document, source for a source.
When the job last changed, ISO 8601.
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_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}/deletion-jobs/{deletion_job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-jobs/{deletion_job_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{
"checkpoint": "completed",
"completed_at": "2026-10-20T09:00:09Z",
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "completed",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
}