https://retellai.com/?utm_source=discord&utm_medium=seo logo
using this code in js but it is not working fine i...
# ❓・ai-evy-support
a
Thanks for tagging me @Shahzaib. I'll look through relevant sources and get back to you shortly.
### Answer I don't have documentation covering the specific
/v1/agent/message
endpoint you're trying to use in your code. The available sources show endpoints for retrieving, updating, listing, and publishing agents [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() , but none of them document an agent message endpoint with that structure. The documented endpoints use patterns like: -
GET /get-agent/{agent_id}
[(1) ]() -
PATCH /update-agent/{agent_id}
[(2) ]() -
GET /list-agents
[(4) ]() -
POST /publish-agent/{agent_id}
[(5) ]() Your code also appears to be PHP (not JavaScript as mentioned) , using WordPress functions like
wp_remote_post
and
add_action
. Without documentation for the
/v1/agent/message
endpoint, I can't verify if your request structure is correct. I'd recommend checking if you need a different endpoint or if there's updated API documentation for the messaging functionality you're trying to implement. Would you like me to provide a general answer based on common API integration patterns, or do you have more specific information about what error you're encountering?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
basically I created chat window using html, css, js and php. so how can i use the chatbot API of retell on backend.
@AI Evy @User
a
Thanks for the follow-up, @Shahzaib. I'll get back to you soon.
### Answer --- ### Answer For integrating a Retell Chat Agent into your custom HTML/CSS/JS/PHP chat window, Retell provides an embeddable Chat Widget that you can add directly to your site [(1) ]() . The recommended approach is to use the Retell Chat Widget: You can embed the chat agent by copying and pasting the embed script into your website, replacing the
publicKey
,
agentId
, and
version
. The widget requires a Public Key (not an API key) for authorization, which is designed specifically for frontend use [(2) ]() . To set up: 1. **Get a Public Key**: Navigate to Dashboard → Keys → Public Keys 2. **Embed the widget**: Copy the embed code and add it to your HTML [(1) ]() 3. **No backend work required**: The widget handles the chat interaction directly Important note about your current code: The
/v1/agent/message
endpoint you're trying to use in your PHP code is not documented in the available sources. The Chat Widget approach is the officially documented method for web chat integration . If you need backend control, you would typically: - Use the Chat Widget on the frontend with your Public Key - Handle any custom business logic in your PHP backend separately - Use documented API endpoints for agent management if needed The Chat Widget provides a "modern, lightweight text UI" that enables users to interact with your AI agents without requiring custom backend API integration . Would you like guidance on setting up the Chat Widget, or do you have specific backend requirements that the widget doesn't address? --- **
​ To learn more, see the sources I considered: [[1] Retell AI Chat Agent – Real-Time Web Chat Automation Widget | Retell AI](https://www.retellai.com/blog/meet-retell-chat-agents-build-smarter-web-chats) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
i want to whitelabel the agent that’s why i need my own chatwindow @AI Evy @User
a
Thanks for the follow-up, @Shahzaib. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) [[2] ChatDash | Retell AI APP Partner](https://www.retellai.com/app-partner/chatdash) [[3] Chat Widget, Custom Function Enhancement and more!](https://www.retellai.com/changelog/chat-widget-custom-function-enhancement-and-more) ​
### Answer --- ### Answer For white-labeling the Retell Chat Agent, you have a couple of options: Option 1: Customize the Retell Chat Widget The Retell Chat Widget supports customization attributes that allow you to brand it with your own logo, colors, and title [(1) ]() :
Copy code
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-title="YOUR_CUSTOM_TITLE"
 data-logo-url="YOUR_LOGO_URL"
 data-color="YOUR_CUSTOM_COLOR"
 data-bot-name="YOUR_BOT_NAME"
></script>
This allows you to customize the title, logo URL, and color (hex code) for the widget theme . Option 2: Use ChatDash for White-Label Solution Retell has an app partner called ChatDash that provides white-label client dashboard capabilities [(2) ]() . ChatDash is specifically designed for agencies wanting to offer custom-branded dashboards with personalized logos, domains, and themes . It integrates seamlessly with Retell AI and offers custom branding with your logo, domain, and color scheme . Important Note: I don't have documentation for a direct backend API endpoint (like
/v1/agent/message
) that would allow you to build a completely custom chat interface from scratch. The documented approach uses the embeddable widget with Public Keys for frontend authorization [(1) ]() [(3) ]() . If you need complete control over the UI and backend, you might need to contact Retell support directly about custom integration options beyond what the widget provides. --- **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
what if i want my custom chat window
@AI Evy
a
Thanks for the follow-up, @Shahzaib. I'll get back to you soon.
### Answer I don't have documentation for building a completely custom chat window with direct backend API integration for Retell Chat Agents [(1) ]() . The officially documented approach uses the embeddable Chat Widget with Public Keys for frontend authorization [(1) ]() [(2) ]() . What the documentation shows: The Retell Chat Widget is designed to be embedded via a single
<script>
tag and uses the Retell public key system, allowing direct API calls from the frontend—no backend proxy required [(1) ]() . The widget supports customization through attributes like
data-title
,
data-logo-url
,
data-color
, and
data-bot-name
. For full white-label control: Based on community discussions, the launcher button icon is inside a closed Shadow DOM, which means there isn't a simple way to override it with your own custom UI [(3) ]() . The only documented way to replace it is to build your own custom launcher and connect it to the Retell Chat Widget via the API . Your options: 1. Use the Chat Widget with maximum customization (logo, colors, title, bot name) [(1) ]() 2. Use CSS overrides where possible (though Shadow DOM limits this) [(3) ]() 3. Contact Retell support about custom integration options beyond the widget I don't have documentation for a
/v1/agent/message
endpoint or other backend APIs that would allow you to build a fully custom chat interface from scratch. The widget-based approach is what's currently documented. Would you like me to provide general guidance on custom chat implementa
tions, or would you prefer to reach out to Retell support for custom integration options? **
​ To learn more, see the sources I considered: [[1] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) [[2] Public Keys](https://docs.retellai.com/accounts/public-keys) [[3] Chat Widget Customisation](https://discord.com/channels/1186424376300679209/1387925742007881979) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
is there any option to create apiurl for retell?
@AI Evy
I’ve created a custom chat UI on my website and am trying to connect it to my Retell agent using the public key and agent ID. Currently, when I send a message after submitting the email, I get: "Sorry, I'm having trouble connecting right now. Please try again later." I suspect it’s because my requests are sending the public key and agent ID in the JSON body, but I’m unsure if Retell requires them in request headers. Could you confirm the correct way to integrate a custom frontend with Retell’s API?
@AI Evy
Correct endpoint URL for your agent. Correct headers (Public Key vs Bearer token). Correct request body format. @AI Evy
@AI Evy