abhi_13515
11/21/2025, 6:21 AMAI Evy
11/21/2025, 6:21 AMAI Evy
11/21/2025, 6:22 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(chatResponse.agent_id) ;
This will return the chat details including the agent_id that corresponds to your chat agent.
If you want to list all your chat sessions, you can use the List Chat API: [(3) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponses = await client.chat.list() ;
console.log(chatResponses) ;
Note that Retell AI separates voice agents and chat agents into different API endpoints - voice/call agents use the /agent/ endpoints, [(2) ]() while chat agents use the /chat/ endpoints. [(1) ]() [(3) ]()AI Evy
11/21/2025, 6:22 AMAI Evy
11/21/2025, 6:22 AMabhi_13515
11/21/2025, 6:24 AMabhi_13515
11/21/2025, 6:24 AMAI Evy
11/21/2025, 6:24 AMAI Evy
11/21/2025, 6:24 AMagent_id using query parameters:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponses = await client.chat.list() ;
console.log(chatResponses) ;
While the code example shows listing all chats, the API endpoint supports filtering by agent ID through query parameters. This will return all chat sessions for that specific chat agent, and from there you can access individual chat details including the agent_id, chat_id, chat_status, and other properties.
Each chat object in the response will contain the agent_id field that corresponds to your chat agent.AI Evy
11/21/2025, 6:24 AMAI Evy
11/21/2025, 6:24 AMabhi_13515
11/21/2025, 6:26 AMAI Evy
11/21/2025, 6:26 AMAI Evy
11/21/2025, 6:27 AMlist-agents only returns voice agents even when chat agents exist, and attempting to use get-agent with a chat agent ID results in an "Invalid agent channel" error.
The community discussion suggests that listing and retrieving chat agents may work differently from voice agents, and that list-chat-agents functionality exists but is not currently documented.
Since the documented APIs don't provide a direct way to retrieve chat agent configuration details, I recommend:
Check out these potentially useful sources:
- [Create chat agent]()
- [Get Agent]()
- [API - I cannot get/list chat agents]()
For direct assistance with this specific use case, you can:
- Visit [Contact Sales]()
- Visit [)
Would you like me to provide a general answer based on my knowledge instead?AI Evy
11/21/2025, 6:27 AMAI Evy
11/21/2025, 6:27 AMfez9761
11/21/2025, 7:50 AMabhi_13515
11/22/2025, 5:45 AM