Delete Agent by Id with TeamId

Description

The endpoint Delete Agent by Id with TeamId is used to delete an existing Agent in Leapwork. After the successful deletion of the Agent, the returned response contains information like: ‘AgentId’, ‘IsSuccessful’, etc.

Please note this endpoint will work with the Leapwork Enterprise Edition only. 

The details of the deleted Agent can be validated with the help of the Get Agent by Id endpoint.

Request URL

http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}

Input parameters

Property Type Description Comments
agentId string Unique identifier for an agent agentId can be fetched from response body of Get All Agents endpoint

Examples

Curl


curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb'  'http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}'

PowerShell 

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

Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}" -ContentType "application/json" -Headers $headers -Method DELETE

Response Body

DeleteAgentResponse object:

{
"$id": "1",
"AgentId": "0003f108-bb53-4481-8884-b493f1eaddb3",
"IsSuccessful": true
}

 

Response Object

Field Type Description Values
$id String ID of the internal item (Folder/ Flow/Element etc.)  
AgentId String ID of the agent deleted  
IsSuccessful boolean True, if the agent is deleted successfully True/False


Response Code

200 (OK)

404 (Not Found)

401 (Incorrect Access Key)

400 (Bad Request, asset not found)

500 (Internal Server Error)