[PR #5048] feat: add dataset delete endpoint #24755

Closed
opened 2026-02-21 20:23:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/5048

State: closed
Merged: Yes


Description

The Knowledge API currently supports the creation of Knowledges/Datasets but it does not support the deletion of Knowledges/Datasets. This PR adds the ability to delete Knowledges/Datasets.

This change has already been merged to the dev environment and can be tested there, see https://github.com/langgenius/dify/pull/5035

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I tested it manually with postman and curl.

  • Create an empty dataset e.g. with this command:
curl --location --request POST 'http://127.0.0.1:5001/v1/datasets' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{"name": "I can delet this via api"}'
  • Delete the dataset with this command:
curl --location --request DELETE 'http://127.0.0.1:5001/v1/datasets/{dataset_id}' \
--header 'Authorization: Bearer {api_key}'

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/5048 **State:** closed **Merged:** Yes --- # Description The Knowledge API currently supports the creation of Knowledges/Datasets but it does not support the deletion of Knowledges/Datasets. This PR adds the ability to delete Knowledges/Datasets. This change has already been merged to the dev environment and can be tested there, see https://github.com/langgenius/dify/pull/5035 ## Type of Change - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? I tested it manually with postman and curl. - [ ] Create an empty dataset e.g. with this command: ```bash curl --location --request POST 'http://127.0.0.1:5001/v1/datasets' \ --header 'Authorization: Bearer {api_key}' \ --header 'Content-Type: application/json' \ --data-raw '{"name": "I can delet this via api"}' ``` - [ ] Delete the dataset with this command: ```bash curl --location --request DELETE 'http://127.0.0.1:5001/v1/datasets/{dataset_id}' \ --header 'Authorization: Bearer {api_key}' ``` # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [x] `optional` I have made corresponding changes to the documentation - [x] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:23:37 -05:00
yindo closed this issue 2026-02-21 20:23:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24755