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

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.
document_file_idstringrequired#
Document file ID. From List Document Files.

Headers

Idempotency-Keystringrequired#
Repeating the same key and request with the same API key returns the original job with 202. 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
expectedRevisionintegerrequired#
The document file's current version, from List Document Files or Get Document File. A document file's version is always 1. Not the revision number from List Document Revisions. A stale value answers 409 and nothing is deleted.

Range: >= 1

Responses

application/json
The deletion request was accepted and runs in the background. Get Document File answers 404 from the moment it is accepted. To confirm that it finished, poll Get Deletion Job (the status_url) until run_state is completed or failed.
document_titlestring#
The document's title, for a Delete Document request. It's null when you resend the request with the same Idempotency-Key, and always null for document file deletions.
jobobject#
status_urlstring#
URL of Get Deletion Job for this job: absolute when the deployment sets SERVICE_API_URL, otherwise a path that starts with /v1/. The same value is sent in the Location response header.