Update Call Flow
curl --request PUT \
--url https://api.trillet.ai/v1/api/call-flows/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"description": "<string>",
"direction": "<string>",
"isActive": true,
"isGlobal": true,
"promptType": "<string>",
"prompt": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"isDefault": true,
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"settings": {
"enableHumanLikeVoiceAndTone": true,
"welcomeMessageDelay": 123,
"customerLocation": "<string>",
"utilizePriorCallsContext": true,
"responseSettings": {
"delay": 123,
"workingHours": {
"enabled": true,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
}
},
"security": {
"hipaaCompliance": true,
"publicAccess": true
},
"callSetting": {
"maxCallDuration": 123,
"endCallOnSilence": 123,
"trilletVoiceGuard": true,
"reminderMessages": [
{}
]
},
"knowledgeBaseFiles": [
{
"filename": "<string>",
"key": "<string>",
"url": "<string>"
}
],
"knowledgeBases": [
{}
],
"transfers": [
{}
]
},
"webhooks": [
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"variables": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": true,
"testResponse": "<string>",
"textToSpeak": "<string>"
}
]
}
'import requests
url = "https://api.trillet.ai/v1/api/call-flows/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"direction": "<string>",
"isActive": True,
"isGlobal": True,
"promptType": "<string>",
"prompt": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"isDefault": True,
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"settings": {
"enableHumanLikeVoiceAndTone": True,
"welcomeMessageDelay": 123,
"customerLocation": "<string>",
"utilizePriorCallsContext": True,
"responseSettings": {
"delay": 123,
"workingHours": {
"enabled": True,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
}
},
"security": {
"hipaaCompliance": True,
"publicAccess": True
},
"callSetting": {
"maxCallDuration": 123,
"endCallOnSilence": 123,
"trilletVoiceGuard": True,
"reminderMessages": [{}]
},
"knowledgeBaseFiles": [
{
"filename": "<string>",
"key": "<string>",
"url": "<string>"
}
],
"knowledgeBases": [{}],
"transfers": [{}]
},
"webhooks": [
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"variables": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": True,
"testResponse": "<string>",
"textToSpeak": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
direction: '<string>',
isActive: true,
isGlobal: true,
promptType: '<string>',
prompt: '<string>',
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
dynamicVariableCollections: [
{
id: '<string>',
name: '<string>',
isDefault: true,
variables: [{key: '<string>', value: '<string>'}]
}
],
settings: {
enableHumanLikeVoiceAndTone: true,
welcomeMessageDelay: 123,
customerLocation: '<string>',
utilizePriorCallsContext: true,
responseSettings: {
delay: 123,
workingHours: {
enabled: true,
start: '<string>',
end: '<string>',
timezone: '<string>',
outOfHoursMessage: '<string>'
}
},
security: {hipaaCompliance: true, publicAccess: true},
callSetting: {
maxCallDuration: 123,
endCallOnSilence: 123,
trilletVoiceGuard: true,
reminderMessages: [{}]
},
knowledgeBaseFiles: [{filename: '<string>', key: '<string>', url: '<string>'}],
knowledgeBases: [{}],
transfers: [{}]
},
webhooks: [
{
name: '<string>',
description: '<string>',
url: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>'),
variables: [{name: '<string>', description: '<string>'}],
responseVariables: [{name: '<string>', path: '<string>', description: '<string>'}],
isTesting: true,
testResponse: '<string>',
textToSpeak: '<string>'
}
]
})
};
fetch('https://api.trillet.ai/v1/api/call-flows/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/call-flows/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'direction' => '<string>',
'isActive' => true,
'isGlobal' => true,
'promptType' => '<string>',
'prompt' => '<string>',
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'dynamicVariableCollections' => [
[
'id' => '<string>',
'name' => '<string>',
'isDefault' => true,
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'settings' => [
'enableHumanLikeVoiceAndTone' => true,
'welcomeMessageDelay' => 123,
'customerLocation' => '<string>',
'utilizePriorCallsContext' => true,
'responseSettings' => [
'delay' => 123,
'workingHours' => [
'enabled' => true,
'start' => '<string>',
'end' => '<string>',
'timezone' => '<string>',
'outOfHoursMessage' => '<string>'
]
],
'security' => [
'hipaaCompliance' => true,
'publicAccess' => true
],
'callSetting' => [
'maxCallDuration' => 123,
'endCallOnSilence' => 123,
'trilletVoiceGuard' => true,
'reminderMessages' => [
[
]
]
],
'knowledgeBaseFiles' => [
[
'filename' => '<string>',
'key' => '<string>',
'url' => '<string>'
]
],
'knowledgeBases' => [
[
]
],
'transfers' => [
[
]
]
],
'webhooks' => [
[
'name' => '<string>',
'description' => '<string>',
'url' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'variables' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'responseVariables' => [
[
'name' => '<string>',
'path' => '<string>',
'description' => '<string>'
]
],
'isTesting' => true,
'testResponse' => '<string>',
'textToSpeak' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/call-flows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.trillet.ai/v1/api/call-flows/{id}")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call-flows/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "676b8e123456789012345678",
"workspaceId": "6764d172953253138a3a70f4",
"folderId": null,
"isGlobal": false,
"isPreConfigured": false,
"preConfiguredWorkspaceId": null,
"name": "Customer Support Flow",
"direction": "inbound",
"description": "Handles inbound support calls",
"agent": "676b8e123456789012345679",
"promptType": "simple",
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"flowData": {
"nodes": [
{
"id": "node1",
"type": "start",
"data": {
"prompt": "Welcome to our support line. How can I help you?"
}
}
],
"edges": []
},
"prompt": "Keep the conversation short and friendly.",
"currentPromptId": "676b8e123456789012345680",
"promptVersions": [
{
"_id": "676b8e123456789012345680",
"name": "Prompt Version - 1/15/2025, 3:00:00 PM",
"prompt": "Keep the conversation short and friendly.",
"metadata": {
"notes": ""
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
],
"gemini_prompt": "Keep the conversation short and friendly.",
"startNodeId": null,
"isActive": true,
"agentWebhookUrl": "",
"inboundWebhookUrl": "",
"dynamicVariableCollections": [],
"locations": [],
"webhooks": [],
"settings": {
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"enableHumanLikeVoiceAndTone": false,
"welcomeMessageDelay": 0,
"webhooks": {
"agent": "",
"inbound": ""
},
"customerLocation": "new york",
"transfers": [],
"knowledgeBases": [],
"utilizePriorCallsContext": false,
"callSettings": {
"trilletVoiceGuard": true,
"reminderMessages": []
},
"security": {
"hipaaCompliance": false,
"publicAccess": false
}
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
Call Flows
Update Call Flow
Update an existing call flow.
PUT
/
v1
/
api
/
call-flows
/
{id}
Update Call Flow
curl --request PUT \
--url https://api.trillet.ai/v1/api/call-flows/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"description": "<string>",
"direction": "<string>",
"isActive": true,
"isGlobal": true,
"promptType": "<string>",
"prompt": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"isDefault": true,
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"settings": {
"enableHumanLikeVoiceAndTone": true,
"welcomeMessageDelay": 123,
"customerLocation": "<string>",
"utilizePriorCallsContext": true,
"responseSettings": {
"delay": 123,
"workingHours": {
"enabled": true,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
}
},
"security": {
"hipaaCompliance": true,
"publicAccess": true
},
"callSetting": {
"maxCallDuration": 123,
"endCallOnSilence": 123,
"trilletVoiceGuard": true,
"reminderMessages": [
{}
]
},
"knowledgeBaseFiles": [
{
"filename": "<string>",
"key": "<string>",
"url": "<string>"
}
],
"knowledgeBases": [
{}
],
"transfers": [
{}
]
},
"webhooks": [
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"variables": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": true,
"testResponse": "<string>",
"textToSpeak": "<string>"
}
]
}
'import requests
url = "https://api.trillet.ai/v1/api/call-flows/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"direction": "<string>",
"isActive": True,
"isGlobal": True,
"promptType": "<string>",
"prompt": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"isDefault": True,
"variables": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"settings": {
"enableHumanLikeVoiceAndTone": True,
"welcomeMessageDelay": 123,
"customerLocation": "<string>",
"utilizePriorCallsContext": True,
"responseSettings": {
"delay": 123,
"workingHours": {
"enabled": True,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
}
},
"security": {
"hipaaCompliance": True,
"publicAccess": True
},
"callSetting": {
"maxCallDuration": 123,
"endCallOnSilence": 123,
"trilletVoiceGuard": True,
"reminderMessages": [{}]
},
"knowledgeBaseFiles": [
{
"filename": "<string>",
"key": "<string>",
"url": "<string>"
}
],
"knowledgeBases": [{}],
"transfers": [{}]
},
"webhooks": [
{
"name": "<string>",
"description": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"variables": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": True,
"testResponse": "<string>",
"textToSpeak": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
direction: '<string>',
isActive: true,
isGlobal: true,
promptType: '<string>',
prompt: '<string>',
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
dynamicVariableCollections: [
{
id: '<string>',
name: '<string>',
isDefault: true,
variables: [{key: '<string>', value: '<string>'}]
}
],
settings: {
enableHumanLikeVoiceAndTone: true,
welcomeMessageDelay: 123,
customerLocation: '<string>',
utilizePriorCallsContext: true,
responseSettings: {
delay: 123,
workingHours: {
enabled: true,
start: '<string>',
end: '<string>',
timezone: '<string>',
outOfHoursMessage: '<string>'
}
},
security: {hipaaCompliance: true, publicAccess: true},
callSetting: {
maxCallDuration: 123,
endCallOnSilence: 123,
trilletVoiceGuard: true,
reminderMessages: [{}]
},
knowledgeBaseFiles: [{filename: '<string>', key: '<string>', url: '<string>'}],
knowledgeBases: [{}],
transfers: [{}]
},
webhooks: [
{
name: '<string>',
description: '<string>',
url: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>'),
variables: [{name: '<string>', description: '<string>'}],
responseVariables: [{name: '<string>', path: '<string>', description: '<string>'}],
isTesting: true,
testResponse: '<string>',
textToSpeak: '<string>'
}
]
})
};
fetch('https://api.trillet.ai/v1/api/call-flows/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/call-flows/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'direction' => '<string>',
'isActive' => true,
'isGlobal' => true,
'promptType' => '<string>',
'prompt' => '<string>',
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'dynamicVariableCollections' => [
[
'id' => '<string>',
'name' => '<string>',
'isDefault' => true,
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]
],
'settings' => [
'enableHumanLikeVoiceAndTone' => true,
'welcomeMessageDelay' => 123,
'customerLocation' => '<string>',
'utilizePriorCallsContext' => true,
'responseSettings' => [
'delay' => 123,
'workingHours' => [
'enabled' => true,
'start' => '<string>',
'end' => '<string>',
'timezone' => '<string>',
'outOfHoursMessage' => '<string>'
]
],
'security' => [
'hipaaCompliance' => true,
'publicAccess' => true
],
'callSetting' => [
'maxCallDuration' => 123,
'endCallOnSilence' => 123,
'trilletVoiceGuard' => true,
'reminderMessages' => [
[
]
]
],
'knowledgeBaseFiles' => [
[
'filename' => '<string>',
'key' => '<string>',
'url' => '<string>'
]
],
'knowledgeBases' => [
[
]
],
'transfers' => [
[
]
]
],
'webhooks' => [
[
'name' => '<string>',
'description' => '<string>',
'url' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'variables' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'responseVariables' => [
[
'name' => '<string>',
'path' => '<string>',
'description' => '<string>'
]
],
'isTesting' => true,
'testResponse' => '<string>',
'textToSpeak' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/call-flows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.trillet.ai/v1/api/call-flows/{id}")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call-flows/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"direction\": \"<string>\",\n \"isActive\": true,\n \"isGlobal\": true,\n \"promptType\": \"<string>\",\n \"prompt\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"settings\": {\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"customerLocation\": \"<string>\",\n \"utilizePriorCallsContext\": true,\n \"responseSettings\": {\n \"delay\": 123,\n \"workingHours\": {\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n }\n },\n \"security\": {\n \"hipaaCompliance\": true,\n \"publicAccess\": true\n },\n \"callSetting\": {\n \"maxCallDuration\": 123,\n \"endCallOnSilence\": 123,\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"knowledgeBaseFiles\": [\n {\n \"filename\": \"<string>\",\n \"key\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"transfers\": [\n {}\n ]\n },\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"responseVariables\": [\n {\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"isTesting\": true,\n \"testResponse\": \"<string>\",\n \"textToSpeak\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "676b8e123456789012345678",
"workspaceId": "6764d172953253138a3a70f4",
"folderId": null,
"isGlobal": false,
"isPreConfigured": false,
"preConfiguredWorkspaceId": null,
"name": "Customer Support Flow",
"direction": "inbound",
"description": "Handles inbound support calls",
"agent": "676b8e123456789012345679",
"promptType": "simple",
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"flowData": {
"nodes": [
{
"id": "node1",
"type": "start",
"data": {
"prompt": "Welcome to our support line. How can I help you?"
}
}
],
"edges": []
},
"prompt": "Keep the conversation short and friendly.",
"currentPromptId": "676b8e123456789012345680",
"promptVersions": [
{
"_id": "676b8e123456789012345680",
"name": "Prompt Version - 1/15/2025, 3:00:00 PM",
"prompt": "Keep the conversation short and friendly.",
"metadata": {
"notes": ""
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
],
"gemini_prompt": "Keep the conversation short and friendly.",
"startNodeId": null,
"isActive": true,
"agentWebhookUrl": "",
"inboundWebhookUrl": "",
"dynamicVariableCollections": [],
"locations": [],
"webhooks": [],
"settings": {
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"enableHumanLikeVoiceAndTone": false,
"welcomeMessageDelay": 0,
"webhooks": {
"agent": "",
"inbound": ""
},
"customerLocation": "new york",
"transfers": [],
"knowledgeBases": [],
"utilizePriorCallsContext": false,
"callSettings": {
"trilletVoiceGuard": true,
"reminderMessages": []
},
"security": {
"hipaaCompliance": false,
"publicAccess": false
}
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
Headers
string
required
API key used for authenticating requests to the API.
string
required
Workspace identifier for the API.
Path Parameters
string
required
The unique ID of the call flow to update.
Request Body
string
New name for the flow.
string
Updated description for the call flow (e.g., “Updated description for inbound calls”).
string
The direction of the call flow. ‘outbound’ or ‘bidirectional’
boolean
Whether the call flow is currently active.
boolean
Whether this is a global call flow (requires special permissions).
string
required
The type of prompt used in the call flow “simple”.
string
The primary prompt for user interaction (used when promptType is ‘simple’).
string
default:"user_initiated"
Type of welcome message for the call flow. Possible values: “user_initiated”, “ai_dynamic”, “ai_custom”. Defaults to “user_initiated”.
string
Custom welcome message text (used when welcomeMessage is ‘ai_custom’).
array
Collections of dynamic variables for the call flow.
Show dynamicVariableCollections
Show dynamicVariableCollections
object
Configuration settings for the call flow.
Show settings
Show settings
boolean
Whether to enable human-like voice and tone.
number
Delay in seconds before playing the welcome message.
string
Default customer location (e.g., “new york”).
boolean
Whether to use context from previous calls.
object
Show responseSettings
Show responseSettings
number
Delay (in seconds) before responding.
object
object
array
array
Array of knowledge base IDs referenced by the call flow.
array
Array of transfer configurations for the call flow.
array
List of webhooks to be added to the call flow. A new webhook will be created for each entry in the array, regardless of the name or if it already exists.
Show webhooks
Show webhooks
string
required
The name of the webhook (e.g., “Booking”).
string
A brief description of what this webhook does (e.g., “Booking request webhook”).
string
required
The URL to which the webhook will send data (e.g., “https://example.com/webhook/agent”).
string
default:"POST"
HTTP method for the webhook request.
object
Headers to be included in the webhook request.
string
The webhook request body. Can include variable placeholders.
array
array
boolean
Whether this webhook is in testing mode.
string
Mock response for testing purposes.
string
Text to be spoken when this webhook is triggered.
These
endCallOnSilence and maxCallDuration settings are recommended to be sent for optimal API performance, though they are not strictly required.Response Fields
string
The unique identifier for the newly created call flow.
string
The identifier of the workspace where the call flow has been created.
string
The identifier of the folder where the call flow is organized.
boolean
Whether this is a global call flow.
boolean
Whether this call flow is pre-configured.
string
Workspace ID for pre-configured flows.
string
The name given to the call flow.
string
The direction configuration of the call flow; can be “inbound”, “outbound”, or “bidirectional”.
string
A description of what the call flow is designed to handle.
string
The identifier of the agent associated with this call flow.
string
Indicates whether the call flow uses “simple” or “flow” based configuration.
string
Welcome message type configuration.
string
Custom welcome message text if configured.
object
string
The initial or system prompt used in the call flow.
string
ID of the current active prompt version.
string
Sanitized version of the prompt for Gemini processing.
string
ID of the starting node for flow-based configurations.
boolean
Indicates whether the call flow is currently active or inactive.
string
Webhook URL for agent-related events.
string
Webhook URL for inbound call events.
array
Array of dynamic variable collections configured for the call flow.
array
Array of location objects for visual flow positioning.
array
Array of configured webhooks with their complete configuration.
object
string
Timestamp when the call flow was created.
string
Timestamp when the call flow was last updated.
{
"_id": "676b8e123456789012345678",
"workspaceId": "6764d172953253138a3a70f4",
"folderId": null,
"isGlobal": false,
"isPreConfigured": false,
"preConfiguredWorkspaceId": null,
"name": "Customer Support Flow",
"direction": "inbound",
"description": "Handles inbound support calls",
"agent": "676b8e123456789012345679",
"promptType": "simple",
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"flowData": {
"nodes": [
{
"id": "node1",
"type": "start",
"data": {
"prompt": "Welcome to our support line. How can I help you?"
}
}
],
"edges": []
},
"prompt": "Keep the conversation short and friendly.",
"currentPromptId": "676b8e123456789012345680",
"promptVersions": [
{
"_id": "676b8e123456789012345680",
"name": "Prompt Version - 1/15/2025, 3:00:00 PM",
"prompt": "Keep the conversation short and friendly.",
"metadata": {
"notes": ""
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
],
"gemini_prompt": "Keep the conversation short and friendly.",
"startNodeId": null,
"isActive": true,
"agentWebhookUrl": "",
"inboundWebhookUrl": "",
"dynamicVariableCollections": [],
"locations": [],
"webhooks": [],
"settings": {
"welcomeMessage": "user_initiated",
"customWelcomeMessage": "",
"enableHumanLikeVoiceAndTone": false,
"welcomeMessageDelay": 0,
"webhooks": {
"agent": "",
"inbound": ""
},
"customerLocation": "new york",
"transfers": [],
"knowledgeBases": [],
"utilizePriorCallsContext": false,
"callSettings": {
"trilletVoiceGuard": true,
"reminderMessages": []
},
"security": {
"hipaaCompliance": false,
"publicAccess": false
}
},
"createdAt": "2025-01-15T15:00:00.000Z",
"updatedAt": "2025-01-15T15:00:00.000Z"
}
⌘I
