Create Agent Action
Create a new action for a voice AI agent. Actions define specific behaviors and capabilities for the agent during calls.
POST
/
voice-ai
/
actions
Create Agent Action
curl --request POST \
--url https://services.leadconnectorhq.com/voice-ai/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"agentId": "507f1f77bcf86cd799439011",
"locationId": "507f1f77bcf86cd799439012",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": true
}
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentId: '507f1f77bcf86cd799439011',
locationId: '507f1f77bcf86cd799439012',
actionType: 'CALL_TRANSFER',
name: 'Transfer to Manager',
actionParameters: {
triggerPrompt: 'When the caller asks to speak to a manager',
transferToType: 'number',
transferToValue: '+12345678901',
triggerMessage: 'Let me transfer you to a manager right away',
hearWhisperMessage: true
}
})
};
fetch('https://services.leadconnectorhq.com/voice-ai/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/voice-ai/actions"
payload = {
"agentId": "507f1f77bcf86cd799439011",
"locationId": "507f1f77bcf86cd799439012",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": True
}
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "507f1f77bcf86cd799439011",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": true
}
}{
"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
Action created successfully
Last modified on March 7, 2026
Was this page helpful?
Create Agent Action
curl --request POST \
--url https://services.leadconnectorhq.com/voice-ai/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"agentId": "507f1f77bcf86cd799439011",
"locationId": "507f1f77bcf86cd799439012",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": true
}
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agentId: '507f1f77bcf86cd799439011',
locationId: '507f1f77bcf86cd799439012',
actionType: 'CALL_TRANSFER',
name: 'Transfer to Manager',
actionParameters: {
triggerPrompt: 'When the caller asks to speak to a manager',
transferToType: 'number',
transferToValue: '+12345678901',
triggerMessage: 'Let me transfer you to a manager right away',
hearWhisperMessage: true
}
})
};
fetch('https://services.leadconnectorhq.com/voice-ai/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/voice-ai/actions"
payload = {
"agentId": "507f1f77bcf86cd799439011",
"locationId": "507f1f77bcf86cd799439012",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": True
}
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "507f1f77bcf86cd799439011",
"actionType": "CALL_TRANSFER",
"name": "Transfer to Manager",
"actionParameters": {
"triggerPrompt": "When the caller asks to speak to a manager",
"transferToType": "number",
"transferToValue": "+12345678901",
"triggerMessage": "Let me transfer you to a manager right away",
"hearWhisperMessage": true
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}