Install Remote Session Gateway ​
POST /userapi/gatewaydeployments/installgateway/
Installing the Remote Session Gateway for a Gateway Deployment can be achieved by making a POST request on the URL, with the HostName of the Gateway Deployment at the end of the URL. This installs the Passwordstate-Gateway Windows Service on the host, and starts it. If the Windows Service is already installed, it is only started. The account executing this call must have the 'PS Remote Sessions' Security Administrator's role in Passwordstate.
For an Embedded gateway, the Passwordstate Windows Service on the web server performs the install within about a minute. For an External gateway, the Passwordstate Gateway Maintenance Windows Service on the gateway host performs the install within about five minutes.
Note: A Remote Session Gateway certificate must be uploaded for the Gateway Deployment before the Remote Session Gateway can be installed - see Upload Remote Session Gateway Certificate. If you upload a certificate and request the install before it is processed, the certificate is deployed first, so the Windows Service starts with it.
Powershell
# PowerShell Request
$PasswordstateURL = 'https://passwordstate/userapi/gatewaydeployments/installgateway/<HostName>'
Invoke-Restmethod -Method Post -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 200
{
"HostName":"GW01",
"InstallType":"External",
"GatewayCertificateExpiry":"15/11/2027 11:59:00 PM",
"GatewayCertificateInstallDate":"27/10/2026 10:15:32 AM",
"GatewayCertificateDeployPending":"False",
"GatewayServiceInstallPending":"True"
}