Delete Document
Requests the deletion of a document and returns the deletion job. It removes the document, every revision, and the document files that only this document uses. Once the job completes, the document no longer counts toward the document quota.
Send the JSON body with this DELETE. If your client omits bodies on DELETE requests, configure it to send the body explicitly.
For the deletion flow, see Delete Documents and Sources.
1 min read
delete/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}
Request example
Response
delete/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}
Authorization
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.Document ID. From List Documents. To get it from a document file ID, use Get Document by File.
Headers
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/jsonThe document's current
row_version, from Get Document or List Documents. It can be 0. Not a revision number such as active.revision, and not a document file's version. A stale value answers 409 and nothing is deleted.Range: >= 0
Responses
application/json
The deletion request was accepted and runs in the background. From the moment it is accepted, Get Document answers
404 for the document and List Documents leaves it out. To confirm that it finished, poll Get Deletion Job (the status_url) until run_state is completed or failed.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.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.