Delete Folder ​
DELETE /userapi/folders
To delete a Folder, by default there must be no nested Password Lists or Folders beneath the one you are deleting. If you need to also delete nested items, you are required to use the DeleteNested=true parameter.
Deleting a folder can be achieved as per the examples below. Note you must have Administrator rights to the Folder in order to delete it.
Powershell
$PasswordstateURL = 'https://passwordstate/userapi/folders/<FolderID>'
$result = Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }The example below shows how to force deleting of all nested Password Lists and Folders using the DeleteNested=true parameter.
Powershell
$PasswordstateURL = 'https://passwordstate/userapi/folders/<FolderID>?DeleteNested=true'
$result = Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }