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

Delete a document chunk

Deletes a chunk permanently from a document in a knowledge base. Use the knowledge base, document, and chunk identifiers to target the chunk you want to remove. The operation returns no response body when deletion succeeds.

3 parameters
dataset_idstringrequired
The UUID of the knowledge base containing the document.
document_idstringrequired
The UUID of the document containing the chunk.
segment_idstringrequired
The UUID of the chunk to delete.

4 status codes
204Returns no response body and confirms that the chunk was deleted.
400Returned when the embedding model is missing or misconfigured, or when a concurrent request is already deleting the chunk.

One documented failure

  • invalid_param

    Segment is deleting.

    invalid_param (deleting)

403Returned when dataset API access is disabled, the knowledge base request limit is reached, or the API key is not scoped to the knowledge base.

One documented failure

  • forbidden

    Dataset api access is not enabled.

    forbidden (api access)

404Returned when the knowledge base, document, or chunk does not exist.

One documented failure

  • not_found

    Dataset not found.

    not_found

Error handling

A 400 is returned when the embedding model is missing or misconfigured, or when a concurrent request is already deleting the chunk; a 403 is returned when dataset API access, subscription limits, or API key scope prevents the operation. A 404 is returned when the knowledge base, document, or chunk cannot be found. The dataset_id path parameter, document_id path parameter, and segment_id path parameter must be UUIDs.