Leapwork Documentation
Create Remote Agent
Description
The endpoint Create Remote Agent With TeamId is used to create an Agent of Remote Agent type under a specified team in Leapwork. After the successful creation of a Remote Agent, the Id of the Agent is returned in the response.
Please note this endpoint will work with the Leapwork Enterprise Edition only.
The details of the created Agent can be validated with the help of the Get Agent by Id endpoint.
Request URL
http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamid/remoteagent
Input parameters
Property | Type | Description | Comments |
---|---|---|---|
teamId | string | The teamId is a unique Id for the team defined under the LEAPWORK Enterprise Edition. | teamId can be fetched from the Response Body of Get All Team endpoint |
requestBody | application/json |
Unique identifiers for the Remote Agent comprising the following parameters:
|
Kindly refer to the documentation for Agents 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": "" \, "AuthenticationType": "windowsLogin",\
"Password": "string",\
"WindowsLogin": "string",\
"WindowsPassword": "string",\
"LockSessionAfterDisconnect": true\
}' 'http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamid/remoteagent'
PowerShell
$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
$requestBody = @'
{
"Port": "6777",
"Title": "My Remote Agent",
"Description": "Remote Agent",
"HostName": "192.168.1.100",
"Password": "", "AuthenticationType": "windowsLogin",
"Password": "string",
"WindowsLogin": "string",
"WindowsPassword": "string",
"LockSessionAfterDisconnect": true
}
'@
Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamid/remoteagent" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody
Response Body
CreateAgentResponse object:
{ "$id": "1", "AgentId": "4d9c09fe-7ced-4494-8841-378491ebc899" } |
Response Object
Field | Type | Description | Values |
---|---|---|---|
$id | String | ID of internal item (Folder/ Flow/Element etc.) | |
AgentId | String | ID of the Agent created |
Response Code
200 (OK)
404 (Not Found)
401 (Incorrect Access Key)
400 (Bad Request, asset not found)
500 (Internal Server Error)