---
title: "Delete Chunk"
method: DELETE
path: "/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}"
tags: ["Chunks"]
---

# Delete Chunk

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

Permanently delete a chunk from the document.

## Path parameters

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

## Response `204`

Success.

## Other responses

- `400` — - `invalid_param` : The knowledge base uses high-quality indexing but its embedding model is missing or misconfigured. - `invalid_param` : The chunk is already being deleted by a concurrent request.
- `403` — - `forbidden` : Dataset api access is not enabled. - `forbidden` : Sorry, you have reached the knowledge base request rate limit of your subscription.
- `404` — - `not_found` : Dataset not found. - `not_found` : Document not found. - `not_found` : Segment not found.

## Changes

- **2026-07-11** `1647da477789` — 1 info
  - added the non-success response with the status `400`

[Change history](https://skmtc.dev/langgenius/apis/dify-service-api/changes/datasets/:dataset_id/documents/:document_id/segments/:segment_id/delete.md)

---

[API](https://skmtc.dev/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.dev/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/revisions/9c8c06aed889/schema)
