Delete Folder Endpoint
  • 20 Dec 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Delete Folder Endpoint

  • Dark
    Light
  • PDF

Article Summary

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 is true, the folder and all of its contents will be deleted. It is not an error if the folder does not exist. When false 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

ResponseDetails
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?