Delete a Host ​
DELETE /userapi/hosts
Deleting a Host is possible by submitting a 'DELETE' HTTP Verb to the API. When a Host is deleted, you will be returned a Http Status Code 04 204 - NoContent.
Powershell
# Delete using HostName
$PasswordstateURL = 'https://passwordstate/userapi/hosts/<HostName>'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }
# Delete using HostID
$PasswordstateURL = 'https://passwordstate/userapi/hosts/?HostID=<HostID>'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 204 No Content