---
title: "Delete Document"
method: DELETE
path: "/datasets/{dataset_id}/documents/{document_id}"
tags: ["Documents"]
---

# Delete Document

`DELETE /datasets/{dataset_id}/documents/{document_id}`

Permanently deletes a document and all its chunks from the knowledge base.

## Path parameters

- `dataset_id` string, uuid, required
- `document_id` string, uuid, required

## Response `204`

Success.

## Other responses

- `403` — - `archived_document_immutable` : The archived document is not editable. - `forbidden` : Knowledge base API access is not enabled. - `forbidden` : Sorry, you have reached the knowledge base request rate limit of your subscription.
- `404` — `not_found` : The document does not exist. Also returned as "Dataset not found." when the knowledge base itself does not exist.

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/versions/361dc12484f4/schema)
