afrah_85175
08/13/2025, 7:28 AMAI Evy
08/13/2025, 7:28 AMAI Evy
08/13/2025, 7:28 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.retrieve('conversation_flow_id') ;
console.log(conversationFlowResponse.conversation_flow_id) ;
[(2) ]()
To create a new conversation flow:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.create({
model_choice: { model: 'gpt-4o', type: 'cascading' },
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) ;
[(3) ]()
To list all conversation flows:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponses = await client.conversationFlow.list() ;
console.log(conversationFlowResponses) ;AI Evy
08/13/2025, 7:28 AMAI Evy
08/13/2025, 7:28 AM