Create an Agent
Creates a new AI agent for the location. The agent will be created with the specified configuration including name, role, actions, and behavior settings.
POST
/
conversation-ai
/
agents
Create an Agent
curl --request POST \
--url https://services.leadconnectorhq.com/conversation-ai/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"name": "John Doe",
"personality": "Friendly and helpful",
"goal": "Assist customers with inquiries.",
"instructions": "Provide customer service.",
"businessName": "Tech Corp",
"mode": "auto-pilot",
"channels": [
"SMS",
"Live_Chat",
"WhatsApp"
],
"isPrimary": true,
"waitTime": 2,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"sleepTime": 2,
"sleepTimeUnit": "hours",
"autoPilotMaxMessages": 25,
"knowledgeBaseIds": [
"<string>"
],
"respondToImages": true,
"respondToAudio": true
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
personality: 'Friendly and helpful',
goal: 'Assist customers with inquiries.',
instructions: 'Provide customer service.',
businessName: 'Tech Corp',
mode: 'auto-pilot',
channels: ['SMS', 'Live_Chat', 'WhatsApp'],
isPrimary: true,
waitTime: 2,
waitTimeUnit: 'seconds',
sleepEnabled: false,
sleepTime: 2,
sleepTimeUnit: 'hours',
autoPilotMaxMessages: 25,
knowledgeBaseIds: ['<string>'],
respondToImages: true,
respondToAudio: true
})
};
fetch('https://services.leadconnectorhq.com/conversation-ai/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/conversation-ai/agents"
payload = {
"name": "John Doe",
"personality": "Friendly and helpful",
"goal": "Assist customers with inquiries.",
"instructions": "Provide customer service.",
"businessName": "Tech Corp",
"mode": "auto-pilot",
"channels": ["SMS", "Live_Chat", "WhatsApp"],
"isPrimary": True,
"waitTime": 2,
"waitTimeUnit": "seconds",
"sleepEnabled": False,
"sleepTime": 2,
"sleepTimeUnit": "hours",
"autoPilotMaxMessages": 25,
"knowledgeBaseIds": ["<string>"],
"respondToImages": True,
"respondToAudio": True
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "emp_123",
"name": "John Doe",
"mode": "auto-pilot",
"channels": [
"SMS",
"Live_Chat"
],
"waitTime": 30,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"actions": [
{
"id": "actionId123",
"type": "triggerWorkflow"
}
],
"isPrimary": false,
"autoPilotMaxMessages": 25,
"businessName": "Tech Corp",
"sleepTime": 2,
"sleepTimeUnit": "hours",
"goal": "Assist customers with inquiries",
"personality": "Friendly and helpful",
"instructions": "Provide excellent customer service",
"knowledgeBaseIds": [
"kb_123",
"kb_456"
]
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Body
application/json
Response
Successful response
Last modified on March 7, 2026
Was this page helpful?
Create an Agent
curl --request POST \
--url https://services.leadconnectorhq.com/conversation-ai/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"name": "John Doe",
"personality": "Friendly and helpful",
"goal": "Assist customers with inquiries.",
"instructions": "Provide customer service.",
"businessName": "Tech Corp",
"mode": "auto-pilot",
"channels": [
"SMS",
"Live_Chat",
"WhatsApp"
],
"isPrimary": true,
"waitTime": 2,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"sleepTime": 2,
"sleepTimeUnit": "hours",
"autoPilotMaxMessages": 25,
"knowledgeBaseIds": [
"<string>"
],
"respondToImages": true,
"respondToAudio": true
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
personality: 'Friendly and helpful',
goal: 'Assist customers with inquiries.',
instructions: 'Provide customer service.',
businessName: 'Tech Corp',
mode: 'auto-pilot',
channels: ['SMS', 'Live_Chat', 'WhatsApp'],
isPrimary: true,
waitTime: 2,
waitTimeUnit: 'seconds',
sleepEnabled: false,
sleepTime: 2,
sleepTimeUnit: 'hours',
autoPilotMaxMessages: 25,
knowledgeBaseIds: ['<string>'],
respondToImages: true,
respondToAudio: true
})
};
fetch('https://services.leadconnectorhq.com/conversation-ai/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/conversation-ai/agents"
payload = {
"name": "John Doe",
"personality": "Friendly and helpful",
"goal": "Assist customers with inquiries.",
"instructions": "Provide customer service.",
"businessName": "Tech Corp",
"mode": "auto-pilot",
"channels": ["SMS", "Live_Chat", "WhatsApp"],
"isPrimary": True,
"waitTime": 2,
"waitTimeUnit": "seconds",
"sleepEnabled": False,
"sleepTime": 2,
"sleepTimeUnit": "hours",
"autoPilotMaxMessages": 25,
"knowledgeBaseIds": ["<string>"],
"respondToImages": True,
"respondToAudio": True
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "emp_123",
"name": "John Doe",
"mode": "auto-pilot",
"channels": [
"SMS",
"Live_Chat"
],
"waitTime": 30,
"waitTimeUnit": "seconds",
"sleepEnabled": false,
"actions": [
{
"id": "actionId123",
"type": "triggerWorkflow"
}
],
"isPrimary": false,
"autoPilotMaxMessages": 25,
"businessName": "Tech Corp",
"sleepTime": 2,
"sleepTimeUnit": "hours",
"goal": "Assist customers with inquiries",
"personality": "Friendly and helpful",
"instructions": "Provide excellent customer service",
"knowledgeBaseIds": [
"kb_123",
"kb_456"
]
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}