Partially update an existing voice AI agent
PATCH https://services.leadconnectorhq.com/voice-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 | 507f1f77bcf86cd799439011 | Unique agent identifier |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | LOC123456789ABCDEF | Account ID |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
agentName | string | No | Customer Support Agent | Display name for the voice AI agent, between 1-40 characters. Default: "My Agent {random 3 digit number}" |
businessName | string | No | Acme Corporation | Name of the business this agent represents. Default: Uses account name |
welcomeMessage | string | No | Hello! Thank you for calling Acme Corporation. How can I assist you today? | Initial greeting spoken when the agent answers calls. Default: Auto generated |
agentPrompt | string | No | You are a helpful customer service representative. Always be polite and professional. | Custom instructions defining the agent's behavior and personality. Default: Basic prompt generated automatically |
voiceId | string | No | 507f1f77bcf86cd799439011 | Identifier for the speech synthesis voice from available voice options. Default: Auto generated |
language | string | No | Language code for the agent's speech and understanding. Default: "en-US" Possible values: 'en-US', 'pt-BR', 'es', 'fr', 'de', 'it', 'nl-NL', 'multi' | |
patienceLevel | string | No | Tolerance level for caller response delays. Default: "high" Possible values: 'low', 'medium', 'high' | |
maxCallDuration | number | No | 600 | Maximum call duration in seconds, between 180-900 (3-15 minutes). Default: 300 seconds (5 minutes) |
sendUserIdleReminders | boolean | No | True | Enables automatic reminders when callers are silent. Default: true |
reminderAfterIdleTimeSeconds | number | No | 5 | Seconds to wait before sending idle reminders, between 1-20. Default: 8 seconds |
inboundNumber | string | No | +1234567890 | Phone number for receiving inbound calls to this agent. Default: null |
numberPoolId | string | No | pool_507f1f77bcf86cd799439011 | Identifier for the number pool managing phone number allocation. Default: null |
callEndWorkflowIds | string[] | No | Array of workflow IDs to trigger automatically when calls end. Default: [] | |
sendPostCallNotificationTo | object | No | Configuration for post-call email notifications to various recipients. Default: [] |
agentWorkingHours(object[]): Time intervals defining when the agent accepts calls, organized by day of week. Default: [] (available 24/7)dayOfTheWeek(number, required): Day of the week for this working hours configuration (Monday=1 to Sunday=7) Possible values: 1, 2, 3, 4, 5, 6, 7 Example:1intervals(object[], required): Array of time intervals when the agent is available on this daystartHour(number, required): Starting hour of the working interval in 24-hour format (0-23) Example:9endHour(number, required): Ending hour of the working interval in 24-hour format (0-23) Example:17startMinute(number, required): Starting minute of the working interval (0-59) Example:0endMinute(number, required): Ending minute of the working interval (0-59) Example:30
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
timezone | string | No | America/New_York | IANA timezone identifier affecting working hours and scheduling. Default: Account timezone |
isAgentAsBackupDisabled | boolean | No | False | Prevents this agent from being used as a fallback option. Default: false (Available as backup agent) |
translation | object | No | Language translation settings including enablement flag and target language code. Rules: (1) translation.enabled can only be true if the agent's language is not en-US; (2) when enabled, translation.language must be either the agent's language or en-US; (3) when enabled, translation.language is required. |
Responses
200 - Agent updated successfully
id(string, required): Unique identifier for the created agent Example:507f1f77bcf86cd799439011locationId(string, required): Unique identifier for the account where this agent operates Example:LOC123456789ABCDEFagentName(string, required): Display name of the voice AI agent Example:Customer Support AgentbusinessName(string, required): Name of the business this agent represents Example:Acme CorporationwelcomeMessage(string, required): Greeting message spoken when the agent answers calls Example:Hello! Thank you for calling. How can I assist you today?agentPrompt(string, required): Custom instructions defining the agent's behavior Example:You are a helpful customer service representative.voiceId(string, required): Identifier for the speech synthesis voice being used Example:507f1f77bcf86cd799439011language(string, required): Language code for the agent's speech and understanding Example:en-USpatienceLevel(string, required): Current tolerance level for caller response delays Example:mediummaxCallDuration(number, required): Maximum call duration in seconds, between 180-900 Example:600sendUserIdleReminders(boolean, required): Indicates whether automatic idle reminders are enabled Example:TruereminderAfterIdleTimeSeconds(number, required): Seconds to wait before sending idle reminders, between 1-20 Example:5inboundNumber(string): Phone number for receiving inbound calls Example:+1234567890numberPoolId(string): Identifier for the number pool managing this agent's phone allocation Example:pool_507f1f77bcf86cd799439011callEndWorkflowIds(string[]): Array of workflow IDs triggered automatically when calls endsendPostCallNotificationTo(object): Current post-call notification settings including recipient configurationagentWorkingHours(object[]): Time intervals when the agent accepts calls, organized by day of weekdayOfTheWeek(number, required): Day of the week for this working hours configuration (Monday=1 to Sunday=7) Possible values: 1, 2, 3, 4, 5, 6, 7 Example:1intervals(object[], required): Array of time intervals when the agent is available on this daystartHour(number, required): Starting hour of the working interval in 24-hour format (0-23) Example:9endHour(number, required): Ending hour of the working interval in 24-hour format (0-23) Example:17startMinute(number, required): Starting minute of the working interval (0-59) Example:0endMinute(number, required): Ending minute of the working interval (0-59) Example:30
timezone(string, required): IANA timezone identifier for working hours and scheduling Example:America/New_YorkisAgentAsBackupDisabled(boolean, required): Indicates whether this agent is excluded from backup scenarios Example:Falsetranslation(object): Current language translation settings including enablement status and target language
{
"id": "507f1f77bcf86cd799439011",
"locationId": "LOC123456789ABCDEF",
"agentName": "Customer Support Agent",
"businessName": "Acme Corporation",
"welcomeMessage": "Hello! Thank you for calling. How can I assist you today?",
"agentPrompt": "You are a helpful customer service representative.",
"voiceId": "507f1f77bcf86cd799439011",
"language": "en-US",
"patienceLevel": "medium",
"maxCallDuration": 600,
"sendUserIdleReminders": true,
"reminderAfterIdleTimeSeconds": 5,
"inboundNumber": "+1234567890",
"numberPoolId": "pool_507f1f77bcf86cd799439011",
"callEndWorkflowIds": [],
"agentWorkingHours": [],
"timezone": "America/New_York",
"isAgentAsBackupDisabled": false
}400 - Bad Request
{}422 - Unprocessable Entity
{}Example
curl -X PATCH 'https://services.leadconnectorhq.com/voice-ai/agents/YOUR_agentId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"agentName": "Customer Support Agent",
"businessName": "Acme Corporation",
"welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
"agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
"voiceId": "507f1f77bcf86cd799439011",
"language": "en-US",
"patienceLevel": "low",
"maxCallDuration": 600,
"sendUserIdleReminders": true,
"reminderAfterIdleTimeSeconds": 5,
"inboundNumber": "+1234567890",
"numberPoolId": "pool_507f1f77bcf86cd799439011",
"callEndWorkflowIds": [
"wf_507f1f77bcf86cd799439011",
"wf_507f1f77bcf86cd799439012"
],
"agentWorkingHours": [
{
"dayOfTheWeek": 1,
"intervals": [
{
"startHour": 9,
"startMinute": 0,
"endHour": 17,
"endMinute": 30
}
]
}
],
"timezone": "America/New_York",
"isAgentAsBackupDisabled": false
}'const response = await fetch('https://services.leadconnectorhq.com/voice-ai/agents/YOUR_agentId', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"agentName": "Customer Support Agent", "businessName": "Acme Corporation", "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?", "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.", "voiceId": "507f1f77bcf86cd799439011", "language": "en-US", "patienceLevel": "low", "maxCallDuration": 600, "sendUserIdleReminders": true, "reminderAfterIdleTimeSeconds": 5, "inboundNumber": "+1234567890", "numberPoolId": "pool_507f1f77bcf86cd799439011", "callEndWorkflowIds": ["wf_507f1f77bcf86cd799439011", "wf_507f1f77bcf86cd799439012"], "agentWorkingHours": [{"dayOfTheWeek": 1, "intervals": [{"startHour": 9, "startMinute": 0, "endHour": 17, "endMinute": 30}]}], "timezone": "America/New_York", "isAgentAsBackupDisabled": false}),
});
const data = await response.json();import os, requests
response = requests.request(
'PATCH',
'https://services.leadconnectorhq.com/voice-ai/agents/YOUR_agentId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"agentName": "Customer Support Agent", "businessName": "Acme Corporation", "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?", "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.", "voiceId": "507f1f77bcf86cd799439011", "language": "en-US", "patienceLevel": "low", "maxCallDuration": 600, "sendUserIdleReminders": true, "reminderAfterIdleTimeSeconds": 5, "inboundNumber": "+1234567890", "numberPoolId": "pool_507f1f77bcf86cd799439011", "callEndWorkflowIds": ["wf_507f1f77bcf86cd799439011", "wf_507f1f77bcf86cd799439012"], "agentWorkingHours": [{"dayOfTheWeek": 1, "intervals": [{"startHour": 9, "startMinute": 0, "endHour": 17, "endMinute": 30}]}], "timezone": "America/New_York", "isAgentAsBackupDisabled": false},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/voice-ai/agents/YOUR_agentId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'agentName': 'Customer Support Agent', 'businessName': 'Acme Corporation', 'welcomeMessage': 'Hello! Thank you for calling Acme Corporation. How can I assist you today?', 'agentPrompt': 'You are a helpful customer service representative. Always be polite and professional.', 'voiceId': '507f1f77bcf86cd799439011', 'language': 'en-US', 'patienceLevel': 'low', 'maxCallDuration': 600, 'sendUserIdleReminders': true, 'reminderAfterIdleTimeSeconds': 5, 'inboundNumber': '+1234567890', 'numberPoolId': 'pool_507f1f77bcf86cd799439011', 'callEndWorkflowIds': ['wf_507f1f77bcf86cd799439011', 'wf_507f1f77bcf86cd799439012'], 'agentWorkingHours': [{'dayOfTheWeek': 1, 'intervals': [{'startHour': 9, 'startMinute': 0, 'endHour': 17, 'endMinute': 30}]}], 'timezone': 'America/New_York', 'isAgentAsBackupDisabled': false}),
]);
$data = json_decode(curl_exec($ch), true);