Deletes an agent and all its versions.
http
DELETE https://services.leadconnectorhq.com/agent-studio/agent/{agentId}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
agentId | string | Yes | p1q2r3s4t5u6v7w8x9y0z1a2 |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | C2QujeCh8ZnC7al2InWR | |
source | string | No | api |
Responses
200 - Agent deleted successfully
success(boolean, required): Success status Example:Truemessage(string, required): Response message Example:Agent deleted successfullyagentId(string): Deleted agent ID Example:p1q2r3s4t5u6v7w8x9y0z1a2
json
{
"success": true,
"message": "Agent deleted successfully",
"agentId": "p1q2r3s4t5u6v7w8x9y0z1a2"
}400 - Bad Request
json
{}404 - Agent not found
422 - Unprocessable Entity
json
{}500 - Internal Server Error
statusCode(number): Example:500message(string): Example:Internal Server Error
json
{
"statusCode": 500,
"message": "Internal Server Error"
}Example
curl -X DELETE 'https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'DELETE',
'https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);