Delete Remote Session Credential Permission ​
DELETE /userapi/rscredentialpermissions
Removing a Remote Session Credential permissions is possible by submitting a 'DELETE' HTTP Verb to the API. When the Remote Session Record permission is removed, you will be returned a Http Status Code of 204 - NoContent.
The user executing the API script must be given access to the following:
- On the screen Administration -> Feature Access -> Hosts tab : 'Specify which users are allowed to have access to the main Hosts Menu'
- On the screen Administration -> Feature Access -> Remote Sessions tab : 'Specify which users are allowed to manage permissions on any Remote Session Credentials they have access to'
- The user must already have permissions to the Remote Session Credential for their account as well
Powershell
# Delete using CredentialID
$Body = @{
CredentialID = "1011"
ApplyPermissionsForUserID = "domain\username"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/userapi/rscredentialpermissions/'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 204 No Content