Create Call Flow
curl --request POST \
--url https://api.trillet.ai/v1/api/call-flows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"promptType": "<string>",
"folderId": "<string>",
"isGlobal": true,
"isPreConfigured": true,
"preConfiguredWorkspaceId": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"flowData": {
"nodes": [
{}
],
"edges": [
{}
]
},
"prompt": "<string>",
"isActive": true,
"agentWebhookUrl": "<string>",
"inboundWebhookUrl": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isDefault": true
}
],
"webhooks": [
{
"name": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"description": "<string>",
"variablesforcallflow": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": true,
"textToSpeak": "<string>",
"testResponse": "<string>"
}
],
"settings": {
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"enableHumanLikeVoiceAndTone": true,
"welcomeMessageDelay": 123,
"webhooks": {
"agent": "<string>",
"inbound": "<string>"
},
"customerLocation": "<string>",
"transfers": [
{}
],
"knowledgeBases": [
{}
],
"utilizePriorCallsContext": true,
"callSettings": {
"trilletVoiceGuard": true,
"reminderMessages": [
{}
]
},
"security": {
"securityOptOut": true,
"publicAccess": true
}
}
}
'import requests
url = "https://api.trillet.ai/v1/api/call-flows"
payload = {
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"promptType": "<string>",
"folderId": "<string>",
"isGlobal": True,
"isPreConfigured": True,
"preConfiguredWorkspaceId": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"flowData": {
"nodes": [{}],
"edges": [{}]
},
"prompt": "<string>",
"isActive": True,
"agentWebhookUrl": "<string>",
"inboundWebhookUrl": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isDefault": True
}
],
"webhooks": [
{
"name": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"description": "<string>",
"variablesforcallflow": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": True,
"textToSpeak": "<string>",
"testResponse": "<string>"
}
],
"settings": {
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"enableHumanLikeVoiceAndTone": True,
"welcomeMessageDelay": 123,
"webhooks": {
"agent": "<string>",
"inbound": "<string>"
},
"customerLocation": "<string>",
"transfers": [{}],
"knowledgeBases": [{}],
"utilizePriorCallsContext": True,
"callSettings": {
"trilletVoiceGuard": True,
"reminderMessages": [{}]
},
"security": {
"securityOptOut": True,
"publicAccess": True
}
}
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
direction: '<string>',
description: '<string>',
agent: '<string>',
promptType: '<string>',
folderId: '<string>',
isGlobal: true,
isPreConfigured: true,
preConfiguredWorkspaceId: '<string>',
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
flowData: {nodes: [{}], edges: [{}]},
prompt: '<string>',
isActive: true,
agentWebhookUrl: '<string>',
inboundWebhookUrl: '<string>',
dynamicVariableCollections: [
{
id: '<string>',
name: '<string>',
variables: [{key: '<string>', value: '<string>'}],
isDefault: true
}
],
webhooks: [
{
name: '<string>',
url: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>'),
description: '<string>',
variablesforcallflow: [{name: '<string>', description: '<string>'}],
responseVariables: [{name: '<string>', path: '<string>', description: '<string>'}],
isTesting: true,
textToSpeak: '<string>',
testResponse: '<string>'
}
],
settings: {
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
enableHumanLikeVoiceAndTone: true,
welcomeMessageDelay: 123,
webhooks: {agent: '<string>', inbound: '<string>'},
customerLocation: '<string>',
transfers: [{}],
knowledgeBases: [{}],
utilizePriorCallsContext: true,
callSettings: {trilletVoiceGuard: true, reminderMessages: [{}]},
security: {securityOptOut: true, publicAccess: true}
}
})
};
fetch('https://api.trillet.ai/v1/api/call-flows', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'direction' => '<string>',
'description' => '<string>',
'agent' => '<string>',
'promptType' => '<string>',
'folderId' => '<string>',
'isGlobal' => true,
'isPreConfigured' => true,
'preConfiguredWorkspaceId' => '<string>',
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'flowData' => [
'nodes' => [
[
]
],
'edges' => [
[
]
]
],
'prompt' => '<string>',
'isActive' => true,
'agentWebhookUrl' => '<string>',
'inboundWebhookUrl' => '<string>',
'dynamicVariableCollections' => [
[
'id' => '<string>',
'name' => '<string>',
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'isDefault' => true
]
],
'webhooks' => [
[
'name' => '<string>',
'url' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'description' => '<string>',
'variablesforcallflow' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'responseVariables' => [
[
'name' => '<string>',
'path' => '<string>',
'description' => '<string>'
]
],
'isTesting' => true,
'textToSpeak' => '<string>',
'testResponse' => '<string>'
]
],
'settings' => [
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'enableHumanLikeVoiceAndTone' => true,
'welcomeMessageDelay' => 123,
'webhooks' => [
'agent' => '<string>',
'inbound' => '<string>'
],
'customerLocation' => '<string>',
'transfers' => [
[
]
],
'knowledgeBases' => [
[
]
],
'utilizePriorCallsContext' => true,
'callSettings' => [
'trilletVoiceGuard' => true,
'reminderMessages' => [
[
]
]
],
'security' => [
'securityOptOut' => true,
'publicAccess' => true
]
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.trillet.ai/v1/api/call-flows")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\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
Create Call Flow
Create a new call flow with full settings.
POST
/
v1
/
api
/
call-flows
Create Call Flow
curl --request POST \
--url https://api.trillet.ai/v1/api/call-flows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"promptType": "<string>",
"folderId": "<string>",
"isGlobal": true,
"isPreConfigured": true,
"preConfiguredWorkspaceId": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"flowData": {
"nodes": [
{}
],
"edges": [
{}
]
},
"prompt": "<string>",
"isActive": true,
"agentWebhookUrl": "<string>",
"inboundWebhookUrl": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isDefault": true
}
],
"webhooks": [
{
"name": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"description": "<string>",
"variablesforcallflow": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": true,
"textToSpeak": "<string>",
"testResponse": "<string>"
}
],
"settings": {
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"enableHumanLikeVoiceAndTone": true,
"welcomeMessageDelay": 123,
"webhooks": {
"agent": "<string>",
"inbound": "<string>"
},
"customerLocation": "<string>",
"transfers": [
{}
],
"knowledgeBases": [
{}
],
"utilizePriorCallsContext": true,
"callSettings": {
"trilletVoiceGuard": true,
"reminderMessages": [
{}
]
},
"security": {
"securityOptOut": true,
"publicAccess": true
}
}
}
'import requests
url = "https://api.trillet.ai/v1/api/call-flows"
payload = {
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"promptType": "<string>",
"folderId": "<string>",
"isGlobal": True,
"isPreConfigured": True,
"preConfiguredWorkspaceId": "<string>",
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"flowData": {
"nodes": [{}],
"edges": [{}]
},
"prompt": "<string>",
"isActive": True,
"agentWebhookUrl": "<string>",
"inboundWebhookUrl": "<string>",
"dynamicVariableCollections": [
{
"id": "<string>",
"name": "<string>",
"variables": [
{
"key": "<string>",
"value": "<string>"
}
],
"isDefault": True
}
],
"webhooks": [
{
"name": "<string>",
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"description": "<string>",
"variablesforcallflow": [
{
"name": "<string>",
"description": "<string>"
}
],
"responseVariables": [
{
"name": "<string>",
"path": "<string>",
"description": "<string>"
}
],
"isTesting": True,
"textToSpeak": "<string>",
"testResponse": "<string>"
}
],
"settings": {
"welcomeMessage": "<string>",
"customWelcomeMessage": "<string>",
"enableHumanLikeVoiceAndTone": True,
"welcomeMessageDelay": 123,
"webhooks": {
"agent": "<string>",
"inbound": "<string>"
},
"customerLocation": "<string>",
"transfers": [{}],
"knowledgeBases": [{}],
"utilizePriorCallsContext": True,
"callSettings": {
"trilletVoiceGuard": True,
"reminderMessages": [{}]
},
"security": {
"securityOptOut": True,
"publicAccess": True
}
}
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
direction: '<string>',
description: '<string>',
agent: '<string>',
promptType: '<string>',
folderId: '<string>',
isGlobal: true,
isPreConfigured: true,
preConfiguredWorkspaceId: '<string>',
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
flowData: {nodes: [{}], edges: [{}]},
prompt: '<string>',
isActive: true,
agentWebhookUrl: '<string>',
inboundWebhookUrl: '<string>',
dynamicVariableCollections: [
{
id: '<string>',
name: '<string>',
variables: [{key: '<string>', value: '<string>'}],
isDefault: true
}
],
webhooks: [
{
name: '<string>',
url: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>'),
description: '<string>',
variablesforcallflow: [{name: '<string>', description: '<string>'}],
responseVariables: [{name: '<string>', path: '<string>', description: '<string>'}],
isTesting: true,
textToSpeak: '<string>',
testResponse: '<string>'
}
],
settings: {
welcomeMessage: '<string>',
customWelcomeMessage: '<string>',
enableHumanLikeVoiceAndTone: true,
welcomeMessageDelay: 123,
webhooks: {agent: '<string>', inbound: '<string>'},
customerLocation: '<string>',
transfers: [{}],
knowledgeBases: [{}],
utilizePriorCallsContext: true,
callSettings: {trilletVoiceGuard: true, reminderMessages: [{}]},
security: {securityOptOut: true, publicAccess: true}
}
})
};
fetch('https://api.trillet.ai/v1/api/call-flows', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'direction' => '<string>',
'description' => '<string>',
'agent' => '<string>',
'promptType' => '<string>',
'folderId' => '<string>',
'isGlobal' => true,
'isPreConfigured' => true,
'preConfiguredWorkspaceId' => '<string>',
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'flowData' => [
'nodes' => [
[
]
],
'edges' => [
[
]
]
],
'prompt' => '<string>',
'isActive' => true,
'agentWebhookUrl' => '<string>',
'inboundWebhookUrl' => '<string>',
'dynamicVariableCollections' => [
[
'id' => '<string>',
'name' => '<string>',
'variables' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'isDefault' => true
]
],
'webhooks' => [
[
'name' => '<string>',
'url' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>',
'description' => '<string>',
'variablesforcallflow' => [
[
'name' => '<string>',
'description' => '<string>'
]
],
'responseVariables' => [
[
'name' => '<string>',
'path' => '<string>',
'description' => '<string>'
]
],
'isTesting' => true,
'textToSpeak' => '<string>',
'testResponse' => '<string>'
]
],
'settings' => [
'welcomeMessage' => '<string>',
'customWelcomeMessage' => '<string>',
'enableHumanLikeVoiceAndTone' => true,
'welcomeMessageDelay' => 123,
'webhooks' => [
'agent' => '<string>',
'inbound' => '<string>'
],
'customerLocation' => '<string>',
'transfers' => [
[
]
],
'knowledgeBases' => [
[
]
],
'utilizePriorCallsContext' => true,
'callSettings' => [
'trilletVoiceGuard' => true,
'reminderMessages' => [
[
]
]
],
'security' => [
'securityOptOut' => true,
'publicAccess' => true
]
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.trillet.ai/v1/api/call-flows")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/call-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"promptType\": \"<string>\",\n \"folderId\": \"<string>\",\n \"isGlobal\": true,\n \"isPreConfigured\": true,\n \"preConfiguredWorkspaceId\": \"<string>\",\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"flowData\": {\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ]\n },\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"agentWebhookUrl\": \"<string>\",\n \"inboundWebhookUrl\": \"<string>\",\n \"dynamicVariableCollections\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"variables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"isDefault\": true\n }\n ],\n \"webhooks\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"variablesforcallflow\": [\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 \"textToSpeak\": \"<string>\",\n \"testResponse\": \"<string>\"\n }\n ],\n \"settings\": {\n \"welcomeMessage\": \"<string>\",\n \"customWelcomeMessage\": \"<string>\",\n \"enableHumanLikeVoiceAndTone\": true,\n \"welcomeMessageDelay\": 123,\n \"webhooks\": {\n \"agent\": \"<string>\",\n \"inbound\": \"<string>\"\n },\n \"customerLocation\": \"<string>\",\n \"transfers\": [\n {}\n ],\n \"knowledgeBases\": [\n {}\n ],\n \"utilizePriorCallsContext\": true,\n \"callSettings\": {\n \"trilletVoiceGuard\": true,\n \"reminderMessages\": [\n {}\n ]\n },\n \"security\": {\n \"securityOptOut\": true,\n \"publicAccess\": true\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.
Request Body
string
required
A friendly name for this call flow (e.g., “Customer Support Flow”).
string
required
Direction of the flow. Possible values: “outbound”, “bidirectional”.
string
Description of the call flow (e.g. “Handles inbound support calls”).
string
ID of the agent to associate with this flow. If provided, the system looks for a pending phone number for that agent and activates it.
string
default:"simple"
required
Only “simple” type of prompt configuration is allowed now.
string
ID of the folder to organize this call flow.
boolean
Whether this is a global call flow. Only specific workspaces can create global flows.
boolean
Whether this call flow is pre-configured. Defaults to false.
string
Workspace ID for pre-configured flows.
string
Welcome message type. Possible values: “user_initiated”, “ai_dynamic”, “ai_custom”. Defaults to “user_initiated”.
string
Custom welcome message text when welcomeMessage is set to “ai_custom” only.
object
Flow-based configuration using a node/edge approach for complex call routing.
Show flowData
Show flowData
array
Array of node objects, each representing a point in the call routing process. Each node object may include properties like
id, type, and data for custom configurations.array
Array of edge objects, connecting the nodes defined in the
nodes array. Each edge object can specify the source and target nodes, along with additional routing logic.string
A system or initial prompt for the flow. This will be used to create the first prompt version.
boolean
Whether the flow is currently active. Defaults to true.
string
Webhook URL for agent-related events.
string
Webhook URL for inbound call events.
array
Array of dynamic variable collections for the call flow.
Show dynamicVariableCollections
Show dynamicVariableCollections
array
Array of webhook configurations for the call flow.
Show webhooks
Show webhooks
string
required
Name of the webhook.
string
required
Webhook URL endpoint.
string
HTTP method. Possible values: “GET”, “POST”, “PUT”, “DELETE”. Defaults to “POST”.
object
Key-value pairs for HTTP headers.
string
Request body content.
string
Description of the webhook purpose.
array
boolean
Whether the webhook is in testing mode.
string
Text to be spoken when webhook is triggered.
string
Mock response for testing purposes.
object
Main configuration object for the call flow.
Show settings
Show settings
string
Welcome message type. Possible values: “user_initiated”, “ai_dynamic”, “ai_custom”.
string
Custom welcome message text.
boolean
Enable human-like voice and tone. Defaults to false.
number
Delay in seconds before welcome message. Defaults to 0.
string
Customer location for the call flow. Defaults to “new york”.
array
Array of transfer configurations.
array
Array of knowledge base IDs to associate with this call flow.
boolean
Whether to utilize context from prior calls. Defaults to false.
object
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
default:"simple"
Only “simple” prompt types allowed now.
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.
array
string
Sanitized version of the prompt for Gemini processing.
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
