Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning centerThe 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.
http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}
Property | Type | Description | Comments |
---|---|---|---|
agentId | string | Unique identifier for an agent | agentId can be fetched from response body of Get All Agents endpoint |
curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}'
$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/agents/delete/{agentId}" -ContentType "application/json" -Headers $headers -Method DELETE
DeleteAgentResponse 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)
©2024, Leapwork. All rights reserved.