Install Remote Session Gateway ​
POST /userapi/remotesitelocations/installgateway/
Installing the Remote Session Gateway for a Remote Site Location can be achieved by making a POST request on the URL, with the SiteID of the Remote Site Location at the end of the URL. The Agent for the Remote Site Location will then install and start the Passwordstate-Gateway Windows Service the next time it polls. If the Windows Service is already installed, the Agent will only start it. The account executing this call must have the 'Remote Site Locations' Security Administrator's role in Passwordstate.
Note: A Remote Session Gateway certificate must be uploaded for the Remote Site Location before the Remote Session Gateway can be installed - see Upload Remote Session Gateway Certificate. If you upload a certificate and request the install before the Agent next polls, the Agent will deploy the certificate first, so the Windows Service starts with it.
Powershell
# PowerShell Request
$PasswordstateURL = 'https://passwordstate/userapi/remotesitelocations/installgateway/<SiteID>'
Invoke-Restmethod -Method Post -Uri $PasswordstateURL -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 200
{
"SiteID":"1",
"SiteLocation":"Contoso",
"GatewayCertificateExpiry":"15/11/2027 11:59:00 PM",
"GatewayCertificateInstallDate":"22/10/2026 10:15:32 AM",
"GatewayCertificateDeployPending":"False",
"GatewayServiceInstallPending":"True"
}