AI Evy
01/15/2026, 7:57 PMAI Evy
01/15/2026, 7:57 PMis_published: false. [(1) ]()
The response you're seeing shows version: 1 with is_published: false — this is expected behavior. Publishing creates a new draft agent with a newer version number.
To publish your chat agent via the API, use:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
await client.chatAgent.publish('16b980523634a6dc504898cda492e939') ;
Key points:
- The is_published property cannot be updated via the Update Agent API — once a version is published, that version's configuration is locked. [(2) ]()
- After publishing, the previously current version becomes the published one, and a new draft version is created (which shows is_published: false) . [(1) ]()
If you're retrieving the agent and seeing is_published: false, you're likely looking at the new draft version, not the published version. You may need to check the [Get Agent Versions]() endpoint to see all versions and their publish status. [(3) ]()AI Evy
01/15/2026, 7:57 PMAI Evy
01/15/2026, 7:57 PMTubussie
01/15/2026, 8:02 PMAI Evy
01/15/2026, 8:02 PMAI Evy
01/15/2026, 8:02 PMAI Evy
01/15/2026, 8:02 PMis_published: true — this is your published/live version [(1) ]()
- Version 1 has is_published: false — this is your new draft version
When you publish, the current version becomes locked as the published version, and a new draft version is automatically created for future edits. [(2) ]()
If your code is checking is_published and returning false, you're likely retrieving the draft version (version 1) instead of the published version (version 0) . To get the published version specifically, use the version query parameter when retrieving your chat agent:
javascript
const chatAgentResponse = await client.chatAgent.retrieve('16b980523634a6dc504898cda492e939') ;
[(3) ]()
You can also use the [Get Agent Versions]() endpoint to list all versions and filter for the one where is_published: true. [(1) ]()AI Evy
01/15/2026, 8:02 PMTubussie
01/15/2026, 8:03 PMAI Evy
01/15/2026, 8:03 PMAI Evy
01/15/2026, 8:03 PMexample.com or localhost for local testing)
2. Missing type="module" attribute
Your script tag is missing the type="module" attribute. The documentation shows it should be included: [(1) ]()
html
<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"
data-title="YOUR_CUSTOM_TITLE"
data-recaptcha-key="YOUR_GOOGLE_RECAPTCHA_SITE_KEY"
></script>
3. Verify your public key format
Ensure your public key starts with the correct prefix (typically key_ based on documentation examples) .
To troubleshoot:
- Add localhost to your allowed domains if testing locally [(2) ]()
- Add type="module" to your script tag
- Confirm the public key and agent ID are correct in your dashboardAI Evy
01/15/2026, 8:03 PMAI Evy
01/15/2026, 8:03 PMTubussie
01/15/2026, 8:09 PMAI Evy
01/15/2026, 8:09 PMAI Evy
01/15/2026, 8:09 PMhtml
<script src="<https://www.google.com/recaptcha/api.js?render=YOUR_GOOGLE_RECAPTCHA_SITE_KEY>"></script>
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="key_xxxxxxxxxxxxxxxxxxxxx"
data-agent-id="agent_xxxxxxxxxxxxxxxxxxx"
data-agent-version="0"
data-title="Chat with us!"
data-recaptcha-key="YOUR_GOOGLE_RECAPTCHA_SITE_KEY"
></script>
Additional checks:
1. Public key format — Documentation examples show keys starting with key_ (e.g., key_xxxxxxxxxxxxxxxxxxxxx) , but yours starts with public_key_. Verify this is the correct format from your dashboard.
2. Domain allowlist — Ensure the domain where you're hosting this page is added to your public key's allowed domains in Dashboard → Keys → Public Keys. [(2) ]() , [(3) ]()
3. reCAPTCHA enabled — If using reCAPTCHA, make sure it's enabled for your public key in the dashboard settings. [(2) ]()
Try swapping the script order first and verify your public key format matches what's shown in your Retell dashboard.AI Evy
01/15/2026, 8:09 PMAI Evy
01/15/2026, 8:09 PMTubussie
01/15/2026, 8:11 PMAI Evy
01/15/2026, 8:11 PMAI Evy
01/15/2026, 8:11 PMpublic_key_...) was likely correct.
2. Domain not in allowlist — Your domain must be added to the allowed domains for that public key. Navigate to Public Keys in your dashboard, click on your key, and add your domain (e.g., vireonai.co.za or localhost for testing) .
3. WordPress path issue — Based on your earlier message, your widget loads from vireonai.co.za/wp/ but you may only have vireonai.co.za allowed. Check DevTools to see the exact Origin being sent on the failed request. [(2) ]()
To fix:
- Use your public key (the one starting with public_key_) , not key_
- Add the exact domain/path where the widget is hosted to your allowed domains list [(1) ]()
- If testing locally, add localhost to allowed domainsAI Evy
01/15/2026, 8:11 PMAI Evy
01/15/2026, 8:11 PMTubussie
01/15/2026, 8:12 PMAI Evy
01/15/2026, 8:12 PMAI Evy
01/15/2026, 8:13 PMAI Evy
01/15/2026, 8:13 PMget-chat/undefined error indicates the widget is attempting to retrieve a chat session but no valid chat_id is being passed. [(1) ]()
Likely causes:
1. Chat session not initializing properly — The widget may be failing to create a chat session before attempting to retrieve it. This could stem from authentication issues (the 401 error you saw earlier) preventing the initial chat creation.
2. Public key/domain mismatch still present — If authentication fails during chat initialization, no chat_id gets generated, causing subsequent API calls to pass undefined. [(2) ]()
Recommended steps:
- Open your browser's DevTools → Network tab
- Filter by retellai.com requests
- Look for the first failing request — this is likely the root cause
- Check if there's a create-chat or similar request failing before the get-chat/undefined call
Verify your configuration matches the documented format:
html
<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>
The undefined chat ID suggests an upstream failure is preventing proper session initialization. Resolving the authentication/domain configuration should fix this.AI Evy
01/15/2026, 8:13 PM