删除作业
获取删除批次
GET
/
knowledge-fs
/
spaces
/
{knowledge_base_id}
/
deletion-batches
/
{deletion_batch_id}
获取删除批次
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_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{
"batch_id": "3e5a7c9b-1d2f-4a6b-8c0d-2e4f6a8b0c1d",
"items": [
{
"document_id": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"document_title": null,
"job": {
"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": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
},
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e"
},
{
"document_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"document_title": null,
"job": {
"checkpoint": "deleting_derived_data",
"completed_at": null,
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "running",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:04Z"
},
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f"
}
],
"results": [
{
"document_id": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"error": null,
"job": {
"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": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
},
"status": "accepted",
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e"
},
{
"document_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"error": null,
"job": {
"checkpoint": "deleting_derived_data",
"completed_at": null,
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "running",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:04Z"
},
"status": "accepted",
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f"
},
{
"document_id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
"error": {
"code": "DURABLE_DELETION_NOT_FOUND",
"message": "Deletion request was rejected",
"retryable": false
},
"job": null,
"status": "rejected",
"status_url": null
}
],
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-batches/3e5a7c9b-1d2f-4a6b-8c0d-2e4f6a8b0c1d",
"total": 3
}Authorizations
Path Parameters
知识库 ID:即知识库 API 访问 对话框中所示服务 API 端点的最后一段(…/knowledge-fs/spaces/<knowledge base ID>),也是地址栏中 /datasets/new/ 之后的那一段。
Response
删除批次,附带每个已受理文件的删除作业当前状态。
Was this page helpful?
⌘I
获取删除批次
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_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-batches/{deletion_batch_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/deletion-batches/{deletion_batch_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{
"batch_id": "3e5a7c9b-1d2f-4a6b-8c0d-2e4f6a8b0c1d",
"items": [
{
"document_id": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"document_title": null,
"job": {
"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": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
},
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e"
},
{
"document_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"document_title": null,
"job": {
"checkpoint": "deleting_derived_data",
"completed_at": null,
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "running",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:04Z"
},
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f"
}
],
"results": [
{
"document_id": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"error": null,
"job": {
"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": "2c1e7a44-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:09Z"
},
"status": "accepted",
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/b7e1c2d3-4f5a-4b6c-8d9e-0f1a2b3c4d5e"
},
{
"document_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"error": null,
"job": {
"checkpoint": "deleting_derived_data",
"completed_at": null,
"created_at": "2026-10-20T09:00:00Z",
"error": null,
"id": "0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"mode": "cascade",
"progress": null,
"retry_at": null,
"run_state": "running",
"target_id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"target_type": "document",
"updated_at": "2026-10-20T09:00:04Z"
},
"status": "accepted",
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-jobs/0c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f"
},
{
"document_id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
"error": {
"code": "DURABLE_DELETION_NOT_FOUND",
"message": "Deletion request was rejected",
"retryable": false
},
"job": null,
"status": "rejected",
"status_url": null
}
],
"status_url": "https://api.example.com/v1/knowledge-fs/spaces/8d2c6a1e-5b3f-4c7d-9e01-2a3b4c5d6e7f/deletion-batches/3e5a7c9b-1d2f-4a6b-8c0d-2e4f6a8b0c1d",
"total": 3
}