Skip to main content
DELETE
Delete Document Files in Batch

Authorizations

Authorization
string
header
required

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).

Headers

Idempotency-Key
string
required

Required identifier for this deletion request. Repeating the same key and request with the same API key returns the original batch and retries its pending files. Reusing the key for a different request, or from another API key, answers 409. Use printable ASCII characters without leading or trailing whitespace.

Required string length: 8 - 255

Path Parameters

knowledge_base_id
string<uuid>
required

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.

Body

application/json

The normalized request must fit within 1,048,576 UTF-8 bytes. See Request Size Limits.

documents
object[]
required

Files to delete. Each documentId must appear once. A larger batch answers 400. The deployment may set a lower cap.

Required array length: 1 - 100 elements

Response

The batch was recorded. results gives each file's outcome, and items lists the accepted files. Deletion runs in the background. Get Document File answers 404 from the moment a file's deletion is accepted. To follow every file to the end, poll Get Deletion Batch (the batch status_url).

Poll the returned job IDs. To retry files left pending, send the same request again with the same Idempotency-Key.

batch_id
string | null

ID of the batch that records this request.

items
object[]

One entry per accepted file.

results
object[]

One entry per requested file, with its outcome.

status_url
string | null

URL of Get Deletion Batch for this batch: absolute when the deployment sets SERVICE_API_URL, otherwise a path that starts with /v1/. Delete Document Files in Batch also sends it in the Location response header.

total
integer

Number of files in the original request.