Delete Folder Endpoint
- 20 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Delete Folder Endpoint
- Updated on 20 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
The Delete Folder is an endpoint in ProGet's Asset Directory API. It deletes a folder at the specified path. This endpoint also allows for deleting files without using an HTTP DELETE
request.
🚀 Quick Example: Deleting a folder with Curl
This example deletes a folder deprecated-files
, authenticating with the API key abc12345
:
curl -X POST --header "X-ApiKey: abc12345" "https://proget.corp.local/endpoints/internal-files/delete/deprecated-files?recursive=true"
Request Specification
To delete a folder, simply POST
to the URL with the AssetDirectoryName
and path to the folder.
POST /endpoints/«AssetDirectoryName»/delete/«path»?recursive=«true/false»
- When
recursive
istrue
, the folder and all of its contents will be deleted. It is not an error if the folder does not exist. Whenfalse
or not specified and the path refers to a folder, it will only be deleted if empty.
Deleting a folder requires the asset directory name (e.g. myAssetDirectory
) and the name of the folder to be deleted (e.g. myFolder
). recursive
is set to true, deleting the contents of the folder as well.
POST /endpoints/myAssetDirectory/delete/myFolder?recursive=true
Deleting a file requires the asset directory name (e.g. myAssetDirectory
) and the name of the file to be deleted (e.g. assetcontent.bin
).
POST /endpoints/myAssetDirectory/delete/assetcontent.bin
Response Specification
Response | Details |
---|---|
200 (Success) | the item (file/folder) is deleted |
400 (Directory Not Empty) | when recursive is set to false , indicates that the directory is not empty |
401 (Authentication Required) | indicates a missing, unknown, or unauthorized API Key |
Was this article helpful?