Delete Host Folder Permissions ​
DELETE /api/hostfolderpermissions
Deleting permissions on a Host Folder record is possible by submitting a 'DELETE' HTTP Verb to the API. When the permissions are deleted, you will be returned a Http Status Code of 204 - NoContent. You must use the Host API Key. Deleting a Host Folder, does not delete any host records from within Passwordstate - it will just remove them from the Host Folder view.
Powershell
#JSON data for the object
$Body = @{
FolderID = "12345"
ApplyPermissionsForUserID = "domain\username"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
$result = Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/hostfolderpermissions' -ContentType "application/json" -Body $jsonData -Header @{ "APIKey" = "<apikey>" }| Heading | Data Type | Description |
|---|---|---|
| FolderID | Integer | Unique identifier for the Host Folder record. Created automatically at the time the Host Folder was added. |
| FolderName | String | The name of the Host Folder |
| ApplyPermissionsForUserID | String (100) | The UserID you wish to apply permissions for |
| ApplyPermissionsForSecurityGroupID | Integer | The SecurityGroupID you wish to apply permissions for. You can only specify SecurityGroupID or SecurityGroupName, not both in the same call. |
| ApplyPermissionsForSecurityGroupName | String (NA) | The Security Group Name you wish to apply permissions for You can only specify SecurityGroupID or SecurityGroupName, not both in the same call. |
| APIKey | String (NA) | Host API Key. This can either be specified in the HTTP Header, or within the POST Body |
Special Note: If you specify the value of 0 for ApplyPermissionsForUserID and ApplyPermissionsForSecurityGroupID, then All Users and Security Groups will be deleted access. Equivalent to "All Users and Security Groups" you see in the UI.