POST
/
v1
/
api
/
call-flows
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>",
  "flowData": {
    "nodes": [
      {}
    ],
    "edges": [
      {}
    ]
  },
  "prompt": "<string>",
  "isActive": true,
  "settings": {
    "knowledgeBases": [
      {}
    ],
    "callSetting": {
      "maxCallDuration": 123,
      "endCallOnSilence": 123
    },
    "responseSettings": {
      "delay": 123
    },
    "security": {
      "hipaaCompliance": true
    }
  }
}'
{
  "_id": "exampleId",
  "workspaceId": "workspacePlaceholder",
  "name": "Customer Support Flow",
  "direction": "inbound",
  "description": "Handles inbound support calls",
  "agent": "agentPlaceholder",
  "promptType": "simple",
  "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.",
  "isActive": true,
  "settings": {
    "knowledgeBases": [],
    "callSetting": {
      "maxCallDuration": 600,
      "endCallOnSilence": 10
    },
    "responseSettings": {
      "delay": 0
    },
    "security": {
      "hipaaCompliance": false
    }
  },
  "createdAt": "2025-01-03T11:00:00Z",
  "updatedAt": "2025-01-03T11:00:00Z",
  "__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: “inbound” “outbound” “bidirectional”.

description
string

Description (e.g. “Handles inbound support calls”).

agent
string
required

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

“simple” or “flow”. Defaults to “simple”.

flowData
object

Flow-based configuration using a node/edge approach.

prompt
string

A system or initial prompt for the flow.

isActive
boolean

Whether the flow is currently active (default: false).

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.

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

Indicates whether the call flow uses a simple prompt or a more complex flow-based configuration.

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.

isActive
boolean

Indicates whether the call flow is currently active or inactive.

settings
object

Configuration settings for various aspects of the call flow, such as knowledge bases, call settings, response settings, and security.

knowledgeBases
array

References to knowledge bases included in the call flow.

callSetting
object

Settings related to the call duration and silence detection.

responseSettings
object

Settings determining the delay before a response is issued in the call.

security
object

Security settings, including HIPAA compliance status.

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": "exampleId",
  "workspaceId": "workspacePlaceholder",
  "name": "Customer Support Flow",
  "direction": "inbound",
  "description": "Handles inbound support calls",
  "agent": "agentPlaceholder",
  "promptType": "simple",
  "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.",
  "isActive": true,
  "settings": {
    "knowledgeBases": [],
    "callSetting": {
      "maxCallDuration": 600,
      "endCallOnSilence": 10
    },
    "responseSettings": {
      "delay": 0
    },
    "security": {
      "hipaaCompliance": false
    }
  },
  "createdAt": "2025-01-03T11:00:00Z",
  "updatedAt": "2025-01-03T11:00:00Z",
  "__v": 0
}