Updates an existing AI agent's configuration. All fields in the agent configuration can be updated including name, status, actions, and behavior settings.
PUT https://services.leadconnectorhq.com/conversation-ai/agents/{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 | Conversations AI agent id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
name | string | No | John Doe | Name of the agent. |
businessName | string | No | Tech Corp | Name of the business the agent represents. |
mode | string | No | Mode of operation for the agent, required if primary is enabled. Possible values: 'off', 'suggestive', 'auto-pilot' | |
channels | string[] | No | Channels the agent can use. | |
isPrimary | boolean | No | True | Indicates if this agent is a primary agent. |
waitTime | number | No | 30 | Wait time before agent responds (max 5 for minutes, 300 for seconds). |
waitTimeUnit | string | No | seconds | Unit for wait time - SECONDS or MINUTES Possible values: 'minutes', 'seconds' |
sleepEnabled | boolean | No | False | Indicates if sleep functionality is enabled. |
sleepTime | number | No | 10 | Duration of sleep period (required if sleepEnabled is true). Set to null for indefinite sleep. (max 2880 for minutes, 172800 for seconds, 48 for hours) |
sleepTimeUnit | string | No | Unit of sleep time - HOURS, MINUTES, or SECONDS (required if sleepEnabled is true). Set to null for indefinite sleep. Possible values: 'hours', 'minutes', 'seconds' | |
personality | string | No | You re an AI assistant and you are friendly and helpful | Personality traits of the agent. |
goal | string | No | You are an AI assistant and you are helping customers with inquiries. | The goal of the agent. |
instructions | string | No | Provide excellent customer service. | Instructions for the agent. |
autoPilotMaxMessages | number | Yes | Maximum number of messages in auto-pilot mode before requiring human intervention. (max: 100, min: 1) | |
knowledgeBaseIds | string[] | No | Array of knowledge base IDs associated with this agent. | |
respondToImages | boolean | No | True | Allow agent to respond to images |
respondToAudio | boolean | No | True | Allow agent to respond to audio |
sleepOnManualMessage | boolean | No | False | Enable sleep when a manual outbound message is sent. |
sleepOnWorkflowMessage | boolean | No | False | Enable sleep when a workflow outbound message is sent. |
Responses
200 - Successful response
id(string, required): Unique identifier for the agent. Example:emp_123name(string, required): Name of the agent. Example:John DoebusinessName(string): Name of the business the agent represents. Example:Tech Corpmode(string, required): Current operating mode of the agent. Possible values: 'off', 'suggestive', 'auto-pilot' Example:auto-pilotchannels(string[], required): Communication channels the agent operates on.waitTime(number, required): Wait time before agent responds. Example:30waitTimeUnit(string, required): Unit for wait time. Possible values: 'minutes', 'seconds' Example:secondssleepEnabled(boolean, required): Indicates if sleep functionality is enabled. Example:FalsesleepTime(number): Duration of sleep period. Example:2sleepTimeUnit(string): Unit of sleep time. Possible values: 'hours', 'minutes', 'seconds' Example:hoursactions(object[], required): List of actions associated with this agent.id(string, required): Unique identifier for the action. Example:actionId123type(string, required): type of action. Possible values: 'triggerWorkflow', 'updateContactField', 'appointmentBooking', 'stopBot', 'humanHandOver', 'advancedFollowup', 'transferBot' Example:triggerWorkflow
isPrimary(boolean, required): Indicates if this agent is a primary agent. Example:FalseautoPilotMaxMessages(number, required): Maximum number of messages in auto-pilot mode before requiring human intervention. Example:25goal(string): The goal of the agent. Example:Assist customers with inquiriespersonality(string): Personality traits of the agent. Example:Friendly and helpfulinstructions(string): Instructions for the agent. Example:Provide excellent customer serviceknowledgeBaseIds(string[]): Array of knowledge base IDs associated with this agent.sleepOnManualMessage(boolean): Whether the bot sleeps on manual outbound messages. Example:FalsesleepOnWorkflowMessage(boolean): Whether the bot sleeps on workflow outbound messages. Example:False
{
"id": "emp_123",
"name": "John Doe",
"businessName": "Tech Corp",
"mode": "auto-pilot",
"channels": [
"SMS",
"Live_Chat"
],
"waitTime": 30,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"sleepTime": 2,
"sleepTimeUnit": "hours",
"actions": [
{
"id": "actionId123",
"type": "triggerWorkflow"
}
],
"isPrimary": false,
"autoPilotMaxMessages": 25,
"goal": "Assist customers with inquiries",
"personality": "Friendly and helpful",
"instructions": "Provide excellent customer service",
"knowledgeBaseIds": [
"kb_123",
"kb_456"
],
"sleepOnManualMessage": false,
"sleepOnWorkflowMessage": false
}400 - Bad Request
{}422 - Unprocessable Entity
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "John Doe",
"businessName": "Tech Corp",
"mode": "off",
"channels": [
"IG"
],
"isPrimary": true,
"waitTime": 30,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"sleepTime": 10,
"sleepTimeUnit": "hours",
"personality": "You re an AI assistant and you are friendly and helpful",
"goal": "You are an AI assistant and you are helping customers with inquiries.",
"instructions": "Provide excellent customer service.",
"autoPilotMaxMessages": 75,
"knowledgeBaseIds": [
"string"
],
"respondToImages": true,
"respondToAudio": true,
"sleepOnManualMessage": false,
"sleepOnWorkflowMessage": false
}'const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "John Doe", "businessName": "Tech Corp", "mode": "off", "channels": ["IG"], "isPrimary": true, "waitTime": 30, "waitTimeUnit": "seconds", "sleepEnabled": false, "sleepTime": 10, "sleepTimeUnit": "hours", "personality": "You re an AI assistant and you are friendly and helpful", "goal": "You are an AI assistant and you are helping customers with inquiries.", "instructions": "Provide excellent customer service.", "autoPilotMaxMessages": 75, "knowledgeBaseIds": ["string"], "respondToImages": true, "respondToAudio": true, "sleepOnManualMessage": false, "sleepOnWorkflowMessage": false}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "John Doe", "businessName": "Tech Corp", "mode": "off", "channels": ["IG"], "isPrimary": true, "waitTime": 30, "waitTimeUnit": "seconds", "sleepEnabled": false, "sleepTime": 10, "sleepTimeUnit": "hours", "personality": "You re an AI assistant and you are friendly and helpful", "goal": "You are an AI assistant and you are helping customers with inquiries.", "instructions": "Provide excellent customer service.", "autoPilotMaxMessages": 75, "knowledgeBaseIds": ["string"], "respondToImages": true, "respondToAudio": true, "sleepOnManualMessage": false, "sleepOnWorkflowMessage": false},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'name': 'John Doe', 'businessName': 'Tech Corp', 'mode': 'off', 'channels': ['IG'], 'isPrimary': true, 'waitTime': 30, 'waitTimeUnit': 'seconds', 'sleepEnabled': false, 'sleepTime': 10, 'sleepTimeUnit': 'hours', 'personality': 'You re an AI assistant and you are friendly and helpful', 'goal': 'You are an AI assistant and you are helping customers with inquiries.', 'instructions': 'Provide excellent customer service.', 'autoPilotMaxMessages': 75, 'knowledgeBaseIds': ['string'], 'respondToImages': true, 'respondToAudio': true, 'sleepOnManualMessage': false, 'sleepOnWorkflowMessage': false}),
]);
$data = json_decode(curl_exec($ch), true);