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
    }
  }
}'
{
  "_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",
  "__v": 0
}

Headers

x-api-key
string
required
API key used for authenticating requests to the API.
x-workspace-id
string
required
Workspace identifier for the API.

Request Body

name
string
required
A friendly name for this call flow (e.g., “Customer Support Flow”).
direction
string
required
Direction of the flow. Possible values: “outbound”, “bidirectional”.
description
string
Description of the call flow (e.g. “Handles inbound support calls”).
agent
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.
promptType
string
default:"simple"
required
Only “simple” type of prompt configuration is allowed now.
folderId
string
ID of the folder to organize this call flow.
isGlobal
boolean
Whether this is a global call flow. Only specific workspaces can create global flows.
isPreConfigured
boolean
Whether this call flow is pre-configured. Defaults to false.
preConfiguredWorkspaceId
string
Workspace ID for pre-configured flows.
welcomeMessage
string
Welcome message type. Possible values: “user_initiated”, “ai_dynamic”, “ai_custom”. Defaults to “user_initiated”.
customWelcomeMessage
string
Custom welcome message text when welcomeMessage is set to “ai_custom” only.
flowData
object
Flow-based configuration using a node/edge approach for complex call routing.
prompt
string
A system or initial prompt for the flow. This will be used to create the first prompt version.
isActive
boolean
Whether the flow is currently active. Defaults to true.
agentWebhookUrl
string
Webhook URL for agent-related events.
inboundWebhookUrl
string
Webhook URL for inbound call events.
dynamicVariableCollections
array
Array of dynamic variable collections for the call flow.
webhooks
array
Array of webhook configurations for the call flow.
settings
object
Main configuration object for the call flow.

Response Fields

_id
string
The unique identifier for the newly created call flow.
workspaceId
string
The identifier of the workspace where the call flow has been created.
folderId
string
The identifier of the folder where the call flow is organized.
isGlobal
boolean
Whether this is a global call flow.
isPreConfigured
boolean
Whether this call flow is pre-configured.
preConfiguredWorkspaceId
string
Workspace ID for pre-configured flows.
name
string
The name given to the call flow.
direction
string
The direction configuration of the call flow; can be “inbound”, “outbound”, or “bidirectional”.
description
string
A description of what the call flow is designed to handle.
agent
string
The identifier of the agent associated with this call flow.
promptType
string
default:"simple"
Only “simple” prompt types allowed now.
welcomeMessage
string
Welcome message type configuration.
customWelcomeMessage
string
Custom welcome message text if configured.
flowData
object
The configuration of nodes and edges that define the call routing logic within the flow.
nodes
array
Detailed configuration of the nodes within the call flow.
edges
array
Configurations of the edges connecting nodes within the call flow.
prompt
string
The initial or system prompt used in the call flow.
currentPromptId
string
ID of the current active prompt version.
promptVersions
array
Array of prompt versions with their metadata.
_id
string
Unique identifier for the prompt version.
name
string
Name of the prompt version.
prompt
string
Prompt content for this version.
metadata
object
Additional metadata including notes.
gemini_prompt
string
Sanitized version of the prompt for Gemini processing.
isActive
boolean
Indicates whether the call flow is currently active or inactive.
agentWebhookUrl
string
Webhook URL for agent-related events.
inboundWebhookUrl
string
Webhook URL for inbound call events.
dynamicVariableCollections
array
Array of dynamic variable collections configured for the call flow.
locations
array
Array of location objects for visual flow positioning.
webhooks
array
Array of configured webhooks with their complete configuration.
settings
object
Configuration settings for various aspects of the call flow, including welcome messages, webhooks, knowledge bases, call settings, and security.
security
object
Security settings with processed values.
hipaaCompliance
boolean
HIPAA compliance status (processed from securityOptOut).
publicAccess
boolean
Public access configuration.
createdAt
string
Timestamp when the call flow was created.
updatedAt
string
Timestamp when the call flow was last updated.
__v
number
The version number of the call flow document.
{
  "_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",
  "__v": 0
}