vishal.gopinath
12/05/2025, 11:19 AMAI Evy
12/05/2025, 11:19 AMAI Evy
12/05/2025, 11:20 AMhtml
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_CHAT_AGENT_ID"
data-agent-version="YOUR_AGENT_VERSION"
></script>
Key requirements to verify :
- You must use a chat agent ID (not a voice agent ID) for the chat widget
- You need a valid Retell Public Key (not an API key)
- If using reCAPTCHA, ensure you're using reCAPTCHA v3 (v2 is not supported)
If you're making direct API calls, the Create Chat Completion endpoint expects [(2) ]() :
- A valid chat_id
- User message content
- Proper authorization header with your API key
For further assistance with this specific 500 error, I recommend:
Check out these potentially useful sources: [Retell Website Widget]() , [Create Chat Completion]()
You can also visit [Contact Sales]() or [) for additional support.
Would you like me to provide a general troubleshooting approach for 500 errors?AI Evy
12/05/2025, 11:20 AMAI Evy
12/05/2025, 11:20 AMvishal.gopinath
12/05/2025, 11:23 AMvishal.gopinath
12/05/2025, 11:45 AMAI Evy
12/05/2025, 11:45 AMAI Evy
12/05/2025, 11:46 AMget-chat/undefined, create-chat, and create-chat-completion.
The get-chat/undefined error indicates the widget is trying to retrieve a chat with an undefined chat_id [(1) ]() . This typically happens when the initial chat creation fails.
For the Create Chat endpoint, verify your request includes [(2) ]() :
- agent_id (required) - the chat agent ID
- Valid authorization header with your API key
- Optional: agent_version, metadata, or retell_llm_dynamic_variables
For Create Chat Completion, ensure you're providing [(3) ]() :
- chat_id (required) - unique ID of the chat
- content (required) - the user message
- Proper authorization header
The 500 errors suggest either:
1. Invalid agent configuration (check that your agent_id exists and is properly configured as a chat agent) [(2) ]() [(4) ]()
2. Missing or invalid API credentials in the authorization header [(3) ]() [(2) ]()
3. Malformed request payload
Check out these potentially useful sources: [Create Chat]() , [Create Chat Completion]() , [Get Chat]()
For additional support, visit [Contact Sales]() or [) .
Would you like a general troubleshooting approach for debuAI Evy
12/05/2025, 11:46 AMAI Evy
12/05/2025, 11:46 AMAI Evy
12/05/2025, 11:46 AMvishal.gopinath
12/05/2025, 11:47 AMvishal.gopinath
12/05/2025, 11:58 AMAI Evy
12/05/2025, 11:58 AMAI Evy
12/05/2025, 11:58 AMAI Evy
12/05/2025, 11:58 AMchat_id [(1) ]() . This happens when the initial chat creation fails or the chat_id isn't being properly stored/passed to subsequent API calls .
The Get Chat endpoint requires a valid chat_id in the path parameter to retrieve chat details . When the widget shows undefined, it means no valid chat_id exists yet .
Since you're seeing this error immediately upon clicking the widget, the root cause is likely in your widget initialization. Double-check that:
1. Your data-agent-id in the widget script tag points to a valid chat agent (not a voice agent)
2. Your data-public-key is correctly set with your Retell Public Key
3. The agent specified exists and is properly configured for chat mode
The 500 errors on create-chat and create-chat-completion endpoints suggest the initial chat creation is failing [(2) ]() , which prevents a valid chat_id from being generated [(1) ]() . This cascades into the undefined error when the widget tries to fetch the non-existent chat .
Check your browser's Network tab to inspect the actual request payload being sent to /create-chat. Verify it includes a valid agent_id [(2) ]() .
Check out these potentially useful sources: [Get Chat]() , [Create Chat Completion]()
For additional support, visit [Contact Sales]() or [) .
Would you like a general troubAI Evy
12/05/2025, 11:58 AMAI Evy
12/05/2025, 11:58 AM