Delete Remote Session Credential ​
DELETE /api/rscredentials
Deleting an existing Remote Session Credential object can be achieved by making a DELETE request on the URL, with appropriate fields forming the HTTP message body. You must use the Remote Session Credentials API Key.
The PowerShell example below deletes the Remote Session Credential record, based on the CredentialID field. The Description field can also be used here, as long as the Description is unique in the database.
Powershell
#JSON data for the object
$Body = @{
CredentialID = "1011"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/rscredentials' -ContentType "application/json" -Body $jsonData -Header @{ "APIKey" = "<apikey>" }Json
# Response
HTTP/1.1 204 No Content