https://retellai.com/?utm_source=discord&utm_medium=seo logo
this is 404ing, plz helpheaders = { "Authorizat...
# ❓・ai-evy-support
b
@AI Evy this is 404ing, plz help headers = { "Authorization": f"Bearer {token}" } response = requests.get( f"https://api.retellai.com/get-agent-versions/{agent_id}", headers=headers )
a
Thanks for tagging me @brytons. I'll look through relevant sources and get back to you shortly.
### Answer The 404 error is likely because the endpoint URL you are using is not correct for the Retell AI API. According to the documentation, the correct endpoint for getting agent versions is:
Copy code
<https://api.retellai.com/v1/agent/%7Bagent_id%7D/versions>
The official Python code example uses the JavaScript SDK, but if you are using requests, your call should look like:
Copy code
python
headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.get(
    f"<https://api.retellai.com/v1/agent/%7Bagent_id%7D/versions%22,>
    headers=headers
)
[(1) ]() Make sure your endpoint matches this format. If you continue to get a 404, double-check that your agent_id is correct and exists in your account. For more, see [Get Agent Versions]() .
b
@AI Evy this is also 404ing client = Retell( api_key="YOUR_RETELL_API_KEY", ) agent_responses = client.agent.get_versions( "16b980523634a6dc504898cda492e939", ) print(agent_responses)
a
Thanks for the follow-up, @brytons. I'll get back to you soon.
### Answer A 404 error when calling client.agent.get_versions(agent_id) in the Retell SDK usually means that the agent_id does not exist or is not accessible with your API key. Double-check that: - The agent_id ("16b980523634a6dc504898cda492e939") is correct and belongs to your account. - The agent exists and is published—use the dashboard or client.agent.list() to verify. - Your API key is valid and has permission to access this agent. If the agent is visible in the dashboard but still returns 404 via the SDK, there may be a sync or permissions issue. This matches known issues where agents are visible in the dashboard but not returned by the API, resulting in 404s [(1) ]() . Check out these potentially useful sources: [Get Agent Versions]() , [List Agents]() , [Agent exists and is published, but API returns "Found agents: 0"]() Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Agent exists and is published, but API returns "Found agents: 0"](https://discord.com/channels/1186424376300679209/1392892371313754164) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
client = Retell( api_key=RETELL_API_KEY, ) agent_responses = client.agent.get_versions( AGENT_ID, ) print(agent_responses)
@AI Evy
a
Thanks for the follow-up, @brytons. I'll get back to you soon.
### Answer A 404 error from client.agent.get_versions(AGENT_ID) means the agent_id is not found or not accessible with your API key. Double-check that: - The AGENT_ID is correct and belongs to your account. - The agent exists—use client.agent.list() to verify which agents are available to your key. - Your API key has access to this agent. Example usage from the docs:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(agentResponses) ;
If the agent is visible in the dashboard but not via API, there may be a sync or permissions issue [(1) ]() , [(2) ]() . Check out these potentially useful sources: [Get Agent Versions]() , [List Agents]() .
​ To learn more, see the sources I considered: [[1] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) [[2] List Agents](https://docs.retellai.com/api-references/list-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy i'm getting "Cannot start a chat session with selected agent."
a
Thanks for the follow-up, @brytons. I'll get back to you soon.
### Answer The error "Cannot start a chat session with selected agent." indicates that the agent you're using is not configured for chat mode. According to the documentation, you must create a chat agent specifically—Retell does not provide native integration with SMS or chat applications for all agents, and only agents set up as chat agents can be used via the chat API [(1) ]() [(2) ]() . To resolve this: 1. In your Retell dashboard, create a new agent and select “Chat Agent” as the agent type, or convert an existing voice agent to a chat agent (note: voice-specific features will be removed) [(1) ]() . 2. Use the agent_id of this chat agent in your API call to create a chat session [(2) ]() . If you attempt to start a chat with an agent that is not a chat agent, you will get this error [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.