Tubussie
01/15/2026, 6:52 PMAI Evy
01/15/2026, 6:52 PMAI Evy
01/15/2026, 6:53 PMundefined in the URL indicates your code is not passing a valid chat_id to the API endpoint. [(1) ]()
The Get Chat endpoint requires a valid chat_id as a path parameter:
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) ;
To fix this:
1. Check where you're obtaining the chat_id in your code before making the request
2. Ensure the variable holding the chat ID is defined and contains a valid string value
3. The chat_id should be a string like "16b980523634a6dc504898cda492e939"
Debug your code to trace where the chat_id becomes `undefined`—this is likely happening because the variable is not being assigned correctly or is being accessed before it's set.AI Evy
01/15/2026, 6:53 PMAI Evy
01/15/2026, 6:53 PMTubussie
01/15/2026, 6:54 PMAI Evy
01/15/2026, 6:54 PMAI Evy
01/15/2026, 6:54 PMexample.com, app.example.com)
4. Save your changes
**Testing on localhost**: Add localhost to your allowed domains list for local development.
## Widget Setup Verification
Ensure your chat widget script includes the required attributes: [(3) ]()
- data-public-key - Your Retell public key
- data-agent-id - Your chat agent ID
## Additional Considerations
A similar issue was reported where the widget wasn't creating a chat ID—this was attributed to a missing agent ID, wrong environment, or WordPress loading the script before the config. [(4) ]()
Double-check the exact domain where the widget is embedded matches what's whitelisted. [(2) ]()
---AI Evy
01/15/2026, 6:54 PMAI Evy
01/15/2026, 6:54 PMAI Evy
01/15/2026, 7:42 PMTubussie
01/15/2026, 7:42 PMAI Evy
01/15/2026, 7:42 PMAI Evy
01/15/2026, 7:42 PMAI Evy
01/15/2026, 7:42 PM403 Forbidden for wp/v2/users/me?context=edit) is a WordPress REST API issue, not a Retell AI issue. This relates to WordPress authentication and user permissions.
## This Is Unrelated to Retell AI
The wp/v2/users/me endpoint is part of the WordPress REST API. The 403 error indicates:
- The WordPress user lacks edit_users capability
- The X-WP-Nonce header is missing or expired
- A WordPress security plugin is blocking the request
## Regarding Your Original Retell Chat Widget Issue
Based on our previous discussion, your actual Retell issue is the 401 Unauthorized error when the chat widget calls POST /create-chat. To resolve that:
1. Verify domain whitelisting in your Retell dashboard under Public Keys
2. Add your exact domain (including localhost for local testing)
3. Confirm your data-public-key and data-agent-id attributes are correct in the widget script
For WordPress-specific REST API issues, you'll need to consult WordPress documentation or support resources, as that falls outside Retell AI's scope.
Is there anything else regarding the Retell chat widget configuration I can help clarify?Tubussie
01/15/2026, 7:47 PMAI Evy
01/15/2026, 7:47 PMAI Evy
01/15/2026, 7:47 PMversion field in the response: [(1) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatAgentResponse = await client.chatAgent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(chatAgentResponse.agent_id) ;
The response includes a version field (integer) representing the version of the chat agent.
## Option 2: Get All Versions of a Chat Agent
If you need to see all versions of a specific chat agent: [(2) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatAgentResponses = await client.chatAgent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(chatAgentResponses) ;
## Option 3: List All Chat Agents
This returns all chat agents with their version information: [(3) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const response = await client.chatAgent.list() ;
Replace the agent ID string with your actual chat agent ID.AI Evy
01/15/2026, 7:47 PMAI Evy
01/15/2026, 7:47 PM