Create remote agent

Description

The endpoint 'Create remote agent' is used to create an environment of remote agent type in Leapwork. After successful creation of Remote Agent environment, the Id of the environment is returned in response.

The details of the created environment can be validated with the help of  Get environment by id endpoint.

Request URL

http://{controllerMachine}:{controllerPort}/api/v3/environments/create/remoteagent

Input parameters

Property Type Description Comments
requestBody application/json

Unique identifiers for the Remote agent environment comprising following parameters:

  • Port
  • Title
  • Description
  • HostName
  • Password

Kindly refer the documentation for Environments for more details on the usage.

 

Examples

Curl


curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \
"Port": "6777", \
"Title": "My Remote Agent Environment", \
"Description": "Remote Agent", \
"HostName": "192.168.1.100", \
"Password": ""
\
}' 'http://{controllerMachine}:{controllerPort}/api/v3/enviroments/create/remoteagent'

PowerShell 

$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")

$requestBody = @'
{
    "Port": "6777",
    "Title": "My Remote Agent Environment",
    "Description": "Remote Agent",
    "HostName": "192.168.1.100",
    "Password": ""

}
'@ 

Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v3/environments/create/remoteagent" -ContentType "application/json" -Headers $headers -Method PUT  -Body $requestBody

Response Body

CreateEnvironmentResponse object:

{

  "$id": "1",

  "EnvironmentId": "4d9c09fe-7ced-4494-8841-378491ebc899"

}

 

Response Object

Field Type Description Values
$id String ID of internal item(Folder/ Flow/Element etc.)  
EnvironmentId String ID of the environment created  


Response Code

200 (OK)

404 (Not Found)

401 (Incorrect Access Key)

400 (Bad Request, asset not found)

500 (Internal Server Error)