https://retellai.com/?utm_source=discord&utm_medium=seo logo
I tested the Retell “get agent” API, and it works ...
# ❓・ai-evy-support
a
@AI Evy I tested the Retell “get agent” API, and it works when I pass a call agent ID. However, when I use a chat agent ID, it returns the error: {"status":"error","message":"Invalid agent channel"}. How can I retrieve chat agent details via the API?
a
Thanks for tagging me @abhi_13515. I'll look through relevant sources and get back to you shortly.
### Answer To retrieve chat agent details, you need to use the Get Chat API endpoint instead of the Get Agent API. [(1) ]() The Get Agent API is specifically for voice/call agents, [(2) ]() which is why you're getting the "Invalid agent channel" error when passing a chat agent ID. To get chat agent details, use this endpoint with your chat ID: [(1) ]()
Copy code
javascript
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) ]()
Copy code
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) ]()
​ To learn more, see the sources I considered: [[1] Get Chat](https://docs.retellai.com/api-references/get-chat) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] List Chat](https://docs.retellai.com/api-references/list-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
The “Get Chat API” requires a chat ID, but I only have the chat agent ID. How can I retrieve this information using only the chat agent ID?
@AI Evy
a
Thanks for the follow-up, @abhi_13515. I'll get back to you soon.
### Answer You can use the List Chat API to retrieve all chat sessions associated with a specific agent. [(1) ]() The List Chat API allows you to filter by
agent_id
using query parameters:
Copy code
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.
​ To learn more, see the sources I considered: [[1] List Chat](https://docs.retellai.com/api-references/list-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy I want to retrieve chat agent settings and language details via the API, not a chat history or details.. The “Get Agent” API provides this information, but only for voice agents. How can I access the same details for a chat agent?
a
Thanks for the follow-up, @abhi_13515. I'll get back to you soon.
### Answer Based on the available documentation, there isn't a dedicated API endpoint specifically for retrieving chat agent configuration details (like settings and language) similar to how the Get Agent API works for voice agents. [(1) ]() However, based on community discussions, there appears to be a gap in the current API documentation regarding chat agent management. [(2) ]() A user reported a similar issue where
list-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?
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] API - I cannot get/list chat agents](https://discord.com/channels/1186424376300679209/1385587883418587206) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
f
abhi_13515 - Retell doesnt support chat agents via the API. Yes, this is super annoying , i found out the same way as you did. There is no clear documentation that chat agents cant be created/updated/ read via API. only UI.
a
@fez9761 I’ve also contacted them here, and I hope they can introduce this feature soon. - https://discord.com/channels/1186424376300679209/1440235198125183006