Create Conversation Flow
Create a new Conversation Flow that can be attached to an agent. This is used to generate response output for the agent.
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const conversationFlowResponse = await client.conversationFlow.create({
nodes: [
{
id: 'start',
instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
type: 'conversation',
},
],
start_speaker: 'agent',
});
console.log(conversationFlowResponse.conversation_flow_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
conversation_flow_response = client.conversation_flow.create(
nodes=[{
"id": "start",
"instruction": {
"text": "Greet the customer and ask how you can help them.",
"type": "prompt",
},
"type": "conversation",
}],
start_speaker="agent",
)
print(conversation_flow_response.conversation_flow_id)curl --request POST \
--url https://api.retellai.com/create-conversation-flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_speaker": "agent",
"nodes": [
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
],
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"begin_after_user_silence_ms": 2000,
"global_prompt": "You are a helpful customer service agent.",
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"components": [
{
"name": "Customer Information Collector",
"nodes": [
{
"id": "collect_info",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Ask the customer for their name and contact information."
}
}
],
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"start_node_id": "collect_info",
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
]
}
],
"start_node_id": "start",
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
},
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"is_transfer_cf": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/create-conversation-flow",
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([
'start_speaker' => 'agent',
'nodes' => [
[
'id' => 'start',
'type' => 'conversation',
'instruction' => [
'type' => 'prompt',
'text' => 'Greet the customer and ask how you can help them.'
],
'edges' => [
[
'id' => 'edge_1',
'transition_condition' => [
'type' => 'prompt',
'prompt' => 'Customer wants to book appointment'
],
'destination_node_id' => 'book_appointment'
]
]
]
],
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model_choice' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true
],
'model_temperature' => 0.7,
'knowledge_base_ids' => [
'kb_001',
'kb_002'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'begin_after_user_silence_ms' => 2000,
'global_prompt' => 'You are a helpful customer service agent.',
'flex_mode' => false,
'tools' => [
[
'type' => 'custom',
'name' => 'get_customer_info',
'description' => 'Get customer information from database',
'tool_id' => 'tool_001',
'url' => 'https://api.example.com/customer',
'method' => 'GET'
]
],
'components' => [
[
'name' => 'Customer Information Collector',
'nodes' => [
[
'id' => 'collect_info',
'type' => 'conversation',
'instruction' => [
'type' => 'prompt',
'text' => 'Ask the customer for their name and contact information.'
]
]
],
'flex_mode' => false,
'tools' => [
[
'type' => 'custom',
'name' => 'get_customer_info',
'description' => 'Get customer information from database',
'tool_id' => 'tool_001',
'url' => 'https://api.example.com/customer',
'method' => 'GET'
]
],
'mcps' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
'Authorization' => 'Bearer 1234567890'
],
'query_params' => [
'index' => '1',
'key' => 'value'
],
'timeout_ms' => 123
]
],
'start_node_id' => 'collect_info',
'begin_tag_display_position' => [
'x' => 100,
'y' => 200
],
'notes' => [
[
'id' => 'note_abc123',
'content' => 'Remember to handle edge cases here.',
'display_position' => [
'x' => 300,
'y' => 150
],
'size' => [
'width' => 200,
'height' => 100
]
]
]
]
],
'start_node_id' => 'start',
'default_dynamic_variables' => [
'company_name' => 'Retell Inc',
'support_hours' => '9 AM - 5 PM'
],
'begin_tag_display_position' => [
'x' => 100,
'y' => 200
],
'notes' => [
[
'id' => 'note_abc123',
'content' => 'Remember to handle edge cases here.',
'display_position' => [
'x' => 300,
'y' => 150
],
'size' => [
'width' => 200,
'height' => 100
]
]
],
'mcps' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
'Authorization' => 'Bearer 1234567890'
],
'query_params' => [
'index' => '1',
'key' => 'value'
],
'timeout_ms' => 123
]
],
'is_transfer_cf' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retellai.com/create-conversation-flow"
payload := strings.NewReader("{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retellai.com/create-conversation-flow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/create-conversation-flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}"
response = http.request(request)
puts response.read_body{
"conversation_flow_id": "<string>",
"version": 123,
"last_modification_timestamp": 1703413636133,
"model_config": {
"type": "cascading",
"primary": {
"model": "gpt-4.1",
"tier": "standard"
},
"backup": {
"model": "gpt-4.1",
"tier": "standard",
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"model": "gpt-4.1",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"model": "gpt-4.1",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"start_speaker": "agent",
"begin_after_user_silence_ms": 2000,
"global_prompt": "You are a helpful customer service agent.",
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"components": [
{
"name": "Customer Information Collector",
"nodes": [
{
"id": "collect_info",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Ask the customer for their name and contact information."
}
}
],
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"start_node_id": "collect_info",
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
]
}
],
"start_node_id": "start",
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
},
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"is_transfer_cf": false,
"nodes": [
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
]
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "Account rate limited, please throttle your requests."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Authorizations
Body
Override properties for conversation flow configuration in agent override requests.
Array of nodes in the conversation flow.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
Show child attributes
Show child attributes
[
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
]
Model settings for the response engine. type decides which models primary and backup accept. On update, each top-level key replaces the current one and omitted keys are kept; set backup to null to remove it. Changing type requires primary and clears backup, while temperature carries over. In agent_override, type is required whenever primary is set; setting backup to null disables it for that call only.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
If set, the AI will begin the conversation after waiting for the user for the duration (in milliseconds) specified by this attribute. This only applies if the agent is configured to wait for the user to speak first. If not set, the agent will wait indefinitely for the user to speak.
2000
Response
Successfully created a conversation flow
Override properties for conversation flow configuration in agent override requests.
Model settings for the response engine. type decides which models primary and backup accept. On update, each top-level key replaces the current one and omitted keys are kept; set backup to null to remove it. Changing type requires primary and clears backup, while temperature carries over. In agent_override, type is required whenever primary is set; setting backup to null disables it for that call only.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
If set, the AI will begin the conversation after waiting for the user for the duration (in milliseconds) specified by this attribute. This only applies if the agent is configured to wait for the user to speak first. If not set, the agent will wait indefinitely for the user to speak.
2000
Array of nodes in the conversation flow.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
Show child attributes
Show child attributes
[
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
]
Was this page helpful?
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const conversationFlowResponse = await client.conversationFlow.create({
nodes: [
{
id: 'start',
instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
type: 'conversation',
},
],
start_speaker: 'agent',
});
console.log(conversationFlowResponse.conversation_flow_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
conversation_flow_response = client.conversation_flow.create(
nodes=[{
"id": "start",
"instruction": {
"text": "Greet the customer and ask how you can help them.",
"type": "prompt",
},
"type": "conversation",
}],
start_speaker="agent",
)
print(conversation_flow_response.conversation_flow_id)curl --request POST \
--url https://api.retellai.com/create-conversation-flow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_speaker": "agent",
"nodes": [
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
],
"model_config": {
"type": "cascading",
"backup": {
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"begin_after_user_silence_ms": 2000,
"global_prompt": "You are a helpful customer service agent.",
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"components": [
{
"name": "Customer Information Collector",
"nodes": [
{
"id": "collect_info",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Ask the customer for their name and contact information."
}
}
],
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"start_node_id": "collect_info",
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
]
}
],
"start_node_id": "start",
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
},
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"is_transfer_cf": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/create-conversation-flow",
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([
'start_speaker' => 'agent',
'nodes' => [
[
'id' => 'start',
'type' => 'conversation',
'instruction' => [
'type' => 'prompt',
'text' => 'Greet the customer and ask how you can help them.'
],
'edges' => [
[
'id' => 'edge_1',
'transition_condition' => [
'type' => 'prompt',
'prompt' => 'Customer wants to book appointment'
],
'destination_node_id' => 'book_appointment'
]
]
]
],
'model_config' => [
'type' => 'cascading',
'backup' => [
'kick_in_timeout_ms' => 30150
],
'temperature' => 0
],
'backup_model' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true,
'backup_kick_in_timeout' => 30150
],
'model_choice' => [
'type' => 'cascading',
'high_priority' => true,
'ultrafast' => true
],
'model_temperature' => 0.7,
'knowledge_base_ids' => [
'kb_001',
'kb_002'
],
'kb_config' => [
'top_k' => 3,
'filter_score' => 0.6
],
'begin_after_user_silence_ms' => 2000,
'global_prompt' => 'You are a helpful customer service agent.',
'flex_mode' => false,
'tools' => [
[
'type' => 'custom',
'name' => 'get_customer_info',
'description' => 'Get customer information from database',
'tool_id' => 'tool_001',
'url' => 'https://api.example.com/customer',
'method' => 'GET'
]
],
'components' => [
[
'name' => 'Customer Information Collector',
'nodes' => [
[
'id' => 'collect_info',
'type' => 'conversation',
'instruction' => [
'type' => 'prompt',
'text' => 'Ask the customer for their name and contact information.'
]
]
],
'flex_mode' => false,
'tools' => [
[
'type' => 'custom',
'name' => 'get_customer_info',
'description' => 'Get customer information from database',
'tool_id' => 'tool_001',
'url' => 'https://api.example.com/customer',
'method' => 'GET'
]
],
'mcps' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
'Authorization' => 'Bearer 1234567890'
],
'query_params' => [
'index' => '1',
'key' => 'value'
],
'timeout_ms' => 123
]
],
'start_node_id' => 'collect_info',
'begin_tag_display_position' => [
'x' => 100,
'y' => 200
],
'notes' => [
[
'id' => 'note_abc123',
'content' => 'Remember to handle edge cases here.',
'display_position' => [
'x' => 300,
'y' => 150
],
'size' => [
'width' => 200,
'height' => 100
]
]
]
]
],
'start_node_id' => 'start',
'default_dynamic_variables' => [
'company_name' => 'Retell Inc',
'support_hours' => '9 AM - 5 PM'
],
'begin_tag_display_position' => [
'x' => 100,
'y' => 200
],
'notes' => [
[
'id' => 'note_abc123',
'content' => 'Remember to handle edge cases here.',
'display_position' => [
'x' => 300,
'y' => 150
],
'size' => [
'width' => 200,
'height' => 100
]
]
],
'mcps' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
'Authorization' => 'Bearer 1234567890'
],
'query_params' => [
'index' => '1',
'key' => 'value'
],
'timeout_ms' => 123
]
],
'is_transfer_cf' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retellai.com/create-conversation-flow"
payload := strings.NewReader("{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.retellai.com/create-conversation-flow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/create-conversation-flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_speaker\": \"agent\",\n \"nodes\": [\n {\n \"id\": \"start\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Greet the customer and ask how you can help them.\"\n },\n \"edges\": [\n {\n \"id\": \"edge_1\",\n \"transition_condition\": {\n \"type\": \"prompt\",\n \"prompt\": \"Customer wants to book appointment\"\n },\n \"destination_node_id\": \"book_appointment\"\n }\n ]\n }\n ],\n \"model_config\": {\n \"type\": \"cascading\",\n \"backup\": {\n \"kick_in_timeout_ms\": 30150\n },\n \"temperature\": 0\n },\n \"backup_model\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true,\n \"backup_kick_in_timeout\": 30150\n },\n \"model_choice\": {\n \"type\": \"cascading\",\n \"high_priority\": true,\n \"ultrafast\": true\n },\n \"model_temperature\": 0.7,\n \"knowledge_base_ids\": [\n \"kb_001\",\n \"kb_002\"\n ],\n \"kb_config\": {\n \"top_k\": 3,\n \"filter_score\": 0.6\n },\n \"begin_after_user_silence_ms\": 2000,\n \"global_prompt\": \"You are a helpful customer service agent.\",\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"components\": [\n {\n \"name\": \"Customer Information Collector\",\n \"nodes\": [\n {\n \"id\": \"collect_info\",\n \"type\": \"conversation\",\n \"instruction\": {\n \"type\": \"prompt\",\n \"text\": \"Ask the customer for their name and contact information.\"\n }\n }\n ],\n \"flex_mode\": false,\n \"tools\": [\n {\n \"type\": \"custom\",\n \"name\": \"get_customer_info\",\n \"description\": \"Get customer information from database\",\n \"tool_id\": \"tool_001\",\n \"url\": \"https://api.example.com/customer\",\n \"method\": \"GET\"\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"start_node_id\": \"collect_info\",\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ]\n }\n ],\n \"start_node_id\": \"start\",\n \"default_dynamic_variables\": {\n \"company_name\": \"Retell Inc\",\n \"support_hours\": \"9 AM - 5 PM\"\n },\n \"begin_tag_display_position\": {\n \"x\": 100,\n \"y\": 200\n },\n \"notes\": [\n {\n \"id\": \"note_abc123\",\n \"content\": \"Remember to handle edge cases here.\",\n \"display_position\": {\n \"x\": 300,\n \"y\": 150\n },\n \"size\": {\n \"width\": 200,\n \"height\": 100\n }\n }\n ],\n \"mcps\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Authorization\": \"Bearer 1234567890\"\n },\n \"query_params\": {\n \"index\": \"1\",\n \"key\": \"value\"\n },\n \"timeout_ms\": 123\n }\n ],\n \"is_transfer_cf\": false\n}"
response = http.request(request)
puts response.read_body{
"conversation_flow_id": "<string>",
"version": 123,
"last_modification_timestamp": 1703413636133,
"model_config": {
"type": "cascading",
"primary": {
"model": "gpt-4.1",
"tier": "standard"
},
"backup": {
"model": "gpt-4.1",
"tier": "standard",
"kick_in_timeout_ms": 30150
},
"temperature": 0
},
"backup_model": {
"type": "cascading",
"model": "gpt-4.1",
"high_priority": true,
"ultrafast": true,
"backup_kick_in_timeout": 30150
},
"model_choice": {
"type": "cascading",
"model": "gpt-4.1",
"high_priority": true,
"ultrafast": true
},
"model_temperature": 0.7,
"knowledge_base_ids": [
"kb_001",
"kb_002"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
},
"start_speaker": "agent",
"begin_after_user_silence_ms": 2000,
"global_prompt": "You are a helpful customer service agent.",
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"components": [
{
"name": "Customer Information Collector",
"nodes": [
{
"id": "collect_info",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Ask the customer for their name and contact information."
}
}
],
"flex_mode": false,
"tools": [
{
"type": "custom",
"name": "get_customer_info",
"description": "Get customer information from database",
"tool_id": "tool_001",
"url": "https://api.example.com/customer",
"method": "GET"
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"start_node_id": "collect_info",
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
]
}
],
"start_node_id": "start",
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
},
"begin_tag_display_position": {
"x": 100,
"y": 200
},
"notes": [
{
"id": "note_abc123",
"content": "Remember to handle edge cases here.",
"display_position": {
"x": 300,
"y": 150
},
"size": {
"width": 200,
"height": 100
}
}
],
"mcps": [
{
"name": "<string>",
"url": "<string>",
"headers": {
"Authorization": "Bearer 1234567890"
},
"query_params": {
"index": "1",
"key": "value"
},
"timeout_ms": 123
}
],
"is_transfer_cf": false,
"nodes": [
{
"id": "start",
"type": "conversation",
"instruction": {
"type": "prompt",
"text": "Greet the customer and ask how you can help them."
},
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
}
]
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "Account rate limited, please throttle your requests."
}{
"status": "error",
"message": "An unexpected server error occurred."
}
