Delete Document File
Requests the deletion of a document file and returns the deletion job. Every revision built on the file stops returning chunks through List Chunks.
To remove a whole document, use Delete Document. Avoid deleting the file of a document’s active revision. The document is left failed with no active revision and drops out of List Documents and Dify’s document list. It still 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.
Authorization
Path parameters
…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.Headers
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/jsonversion, 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
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.null when you resend the request with the same Idempotency-Key, and always null for document file deletions.SERVICE_API_URL, otherwise a path that starts with /v1/. The same value is sent in the Location response header.