https://retellai.com/?utm_source=discord&utm_medium=seo logo
, how can we get post chat report for Retell's cha...
# ❓・ai-evy-support
a
@AI Evy , how can we get post chat report for Retell's chatbot
a
Thanks for tagging me @Ahmad. I'll look through relevant sources and get back to you shortly.
### Answer To get a post-chat report for Retell's chatbot, you can retrieve the
chat_analysis
object from the Get Chat API endpoint after the chat ends. [(1) ]() The
chat_analysis
object includes: - **chat_summary**: A summary of the chat conversation - **user_sentiment**: The sentiment of the user (e.g., "Positive") - **chat_successful**: Whether the chat was successful (boolean) - **custom_analysis_data**: Any custom analysis data you've defined Here's how to retrieve it using the SDK:
Copy code
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) ;
You can also configure custom post-chat analysis when creating or updating your chat agent by setting: [(2) ]() - `post_chat_analysis_data`: Define custom data fields to extract (string, number, boolean, or selector types) - `post_chat_analysis_model`: Choose the model for analysis (defaults to
gpt-4.1-mini
) - `analysis_successful_prompt`: Custom prompt to evaluate chat success - `analysis_summary_prompt`: Custom prompt for summarization To receive the analysis automatically when ready, subscribe to the
chat_analyzed
webhook event. [(1) ]()
​ To learn more, see the sources I considered: [[1] Get Chat](https://docs.retellai.com/api-references/get-chat) [[2] Get Chat Agent](https://docs.retellai.com/api-references/get-chat-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy i have added the webhook in "Agent Level Webhook URL" but it doesn't push the data to that webhook when the chat ends
a
Thanks for the follow-up, @Ahmad. I'll get back to you soon.
### Answer Based on the available sources, here are a few things to check for your chat agent webhook: 1. Verify the webhook URL is properly configured The
webhook_url
field should be set on your chat agent. You can verify this by checking your agent configuration—it should show the URL you've set. [(1) ]() 2. Check the webhook timeout setting The
webhook_timeout_ms
parameter controls the timeout for the webhook in milliseconds. If not set, the default value of 10000 (10 seconds) applies. 3. Ensure your agent is published If your chat agent is not published (
is_published: false
) , this could affect webhook delivery. 4. Known issue with webhooks There have been reports of webhook URLs not saving correctly or being removed in certain scenarios. One community member noted that saving a conversation agent would cause the webhook on the phone number to be lost. [(2) ]() While this was reported for voice agents, similar behavior could potentially affect chat agents. Troubleshooting steps: - Double-check that the webhook URL is still saved after you navigate away and return to the agent settings - Verify your webhook endpoint is publicly accessible and returns a response within the timeout period - Check if you have an account-level webhook configured, as the agent-level webhook should override it when set [(1) ]() If the issue persists after verifying these settings, I'd recommend reaching out to Retell support directly for further investigation. Check out these potentially useful sources: [Create Chat Agent]() , [Webhook Overview]()
​ To learn more, see the sources I considered: [[1] Create Chat Agent](https://docs.retellai.com/api-references/create-chat-agent) [[2] inbound webhook URL failing to save (or stay saved) and wont work together with conversation agaent](https://discord.com/channels/1186424376300679209/1398428473781125314) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.