Skip to main content
delete/knowledge-fs/spaces/{knowledge_base_id}/documents/bulk
Request example
Response
delete/knowledge-fs/spaces/{knowledge_base_id}/documents/bulk

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
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.

Headers

Idempotency-Keystringrequired#
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.

Length: 8–255

Body

application/json
documentsobject[]required#
Files to delete. Each documentId must appear once. A larger batch answers 400. The deployment may set a lower cap.

Items: 1–100

Responses

application/json

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_idstring#
ID of the batch that records this request.
itemsobject[]#
One entry per accepted file.
resultsobject[]#
One entry per requested file, with its outcome.
status_urlstring#
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.
totalinteger#
Number of files in the original request.