Delete Privileged Account Credential Permission ​
DELETE /userapi/privaccountpermissions
Deleting permissions on a Privileged Account Credential entry 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. The account executing this call must have the Privileged Account Credentials Security Administrator's role in Passwordstate.
Powershell
#JSON data for the object
$Body = @{
PrivilegedAccountID = "7"
ApplyPermissionsForSecurityGroupName = "Core Admins"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/userapi'
$result = Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/privaccountpermissions' -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }| Heading | Data Type | Description |
|---|---|---|
| PrivilegedAccountID | Integer | Unique identifier for the Privileged Account Credential Read-only: Created automatically at the time the Privileged Account Credential was added. |
| 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. |
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.