https://retellai.com/?utm_source=discord&utm_medium=seo logo
can you use the api to update conversational flow ...
# ❓・ai-evy-support
m
@AI Evy can you use the api to update conversational flow agents individual nodes
a
Thanks for tagging me @Mikey. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can update conversation flow agents using the API [(1) ]() . The API allows you to update the entire conversation flow, including its nodes . Here's the JavaScript code example for updating a conversation flow:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.update('conversation_flow_id') ;
console.log(conversationFlowResponse.conversation_flow_id) ;
The update operation modifies the entire conversation flow structure, including all nodes within it . When you update a conversation flow, you can modify the
nodes
array which contains all the individual nodes in your flow . Each node in the conversation flow can include properties like
id
,
type
,
instruction
, and
edges
for transitions between nodes . The API doesn't appear to support updating individual nodes in isolation - you update the entire conversation flow structure .
​ To learn more, see the sources I considered: [[1] Update Conversation Flow](https://docs.retellai.com/api-references/update-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy can you api export an agent to json
a
Thanks for the follow-up, @Mikey. I'll get back to you soon.
### Answer Based on the available sources, you can retrieve an agent's configuration in JSON format using the Get Agent API [(1) ]() . Here's the JavaScript code to export an agent:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
This returns the complete agent configuration as a JSON object, including all properties like
agent_id
,
voice_id
,
response_engine
,
voice_model
,
backchannel_words
, and other settings . The API response provides the full agent structure in JSON format . From the Discord discussion, when you export an agent from the dashboard, you also get the format in a JSON file [(2) ]() . However, the sources don't show a specific "export" endpoint - the Get Agent API serves as the way to retrieve the complete agent configuration in JSON format [(1) ]() .
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] Conversation/agent JSON file format](https://discord.com/channels/1186424376300679209/1399111940982177962) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.