Delete Host Folder ​
DELETE /api/hostfolders
Deleting a Host Folder is possible by submitting a 'DELETE' HTTP Verb to the API. When a Host Folder is deleted, you will be returned a Http Status Code of 204 - NoContent. No host records will be deleted from Passwordstate, if they were nested underneath the Folder being deleted.
Powershell
# Delete using FolderName
$Body = @{
FolderID = "12345"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api/hostfolders/'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -ContentType "application/json" -Body $jsonData -Header @{ "APIKey" = "<apikey>" }Json
# Response
HTTP/1.1 204 No Content