https://retellai.com/?utm_source=discord&utm_medium=seo logo
what's the difference between the agent level webh...
# ❓・ai-evy-support
m
@AI Evy what's the difference between the agent level webhook field and the one that I set under phone numbers > inbound call agent? This is for only an inbound call agent
a
Thanks for tagging me @mrearthbound. I'll look through relevant sources and get back to you shortly.
### Answer --- These two webhooks serve different purposes and trigger at different times: ## Phone Number Inbound Webhook (
inbound_webhook_url
) This webhook fires before the call connects when an inbound call is received. [(1) ]() [(2) ]() It allows you to: - Filter and reject unwanted inbound calls [(1) ]() - Override agent id or version for that specific call - Set dynamic variables and metadata for the call - Add context based on the caller before the conversation begins The event type is
call_inbound
and the call object hasn't been created yet at this point. ## Agent Level Webhook This webhook fires during and after the call for call lifecycle events. [(3) ]() It sends events for: -
call_started
- when the call begins -
call_ended
- when the call completes, transfers, or encounters an error -
call_analyzed
- when post-call analysis is complete **In short**: The phone number inbound webhook is for pre-call setup and routing decisions, while the agent level webhook is for tracking call lifecycle events and getting call data after the conversation.
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Get Phone Number](https://docs.retellai.com/api-references/get-phone-number) [[3] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
m
@AI Evy i've called to make my webhook that i've configured in retell that directs to my n8n automation but I'm not getting anything on n8n. help me troubleshoot
a
### Answer Here are some troubleshooting steps for your inbound webhook not triggering in n8n: ## 1. Verify Webhook URL Configuration Make sure your
inbound_webhook_url
is correctly set on the phone number. [(1) ]() ## 2. Check Webhook Response Requirements The webhook has a timeout of 10 seconds. If within 10 seconds no success status (2xx) is received, the webhook will be retried, up to 3 times. [(2) ]() Your n8n webhook must return a 2xx status code for Retell to consider it successful. ## 3. Confirm You're Testing Inbound Calls The inbound webhook only fires for inbound calls to your configured number. It does not fire for outbound calls you initiate. ## 4. Return Valid Response Data A community user experienced a similar issue where returning empty values caused the call to fail with an "inbound webhook error" and the line appeared busy. [(3) ]() If your webhook returns dynamic variables, ensure you're returning values that Retell can process. One workaround suggested was to return placeholder values like "unknown" instead of empty strings when no data is found. ## 5. Test Your Webhook Endpoint Independently Try removing the webhook temporarily to confirm calls work without it, then create a simple test webhook that always returns a valid 200 response with minimal data to isolate whether the issue is with your n8n workflow logic or the webhook connection itself. ## Questions to Help Narrow Down - Are you seeing any error messages in your Retell dashboard? - Is your n8n webhook endpoint publicly accessible (not localhost) ? - What does your n8n webhook response look like?
​ To learn more, see the sources I considered: [[1] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] Discord message from @yves_69297 on 2025-01-16](https://discord.com/channels/1186424376300679209/1186462578310910112/1329371703100571778) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy i'm talking about my agent level webhook. the inbound one works just fine
a
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
### Answer Got it—here are troubleshooting steps for your agent-level webhook not receiving data in n8n: ## 1. Verify Webhook URL on the Agent The agent-level webhook is configured via the
webhook_url
field on the agent itself. [(1) ]() Confirm it's set correctly and points to your publicly accessible n8n endpoint. ## 2. Check Webhook Timeout & Response The webhook has a timeout of 10 seconds. If within 10 seconds no success status (2xx) is received, the webhook will be retried, up to 3 times. [(2) ]() Make sure your n8n webhook responds with a 2xx status code within that window. ## 3. Confirm Call Actually Connected If the call did not connect (like
dial_failed
,
dial_no_answer
,
dial_busy
) , the
call_started
webhook event will not be triggered. It will still trigger
call_ended
and
call_analyzed
. Check your call logs to see if calls are actually connecting. ## 4. Check for 403 or Blocking Issues A community user reported their agent-level webhook was returning 403 even though it worked locally with ngrok. The issue was likely a configuration problem on their server side blocking the requests. [(3) ]() Test your n8n webhook URL using a tool like webhook.site to verify Retell is sending the events. ## 5. Possible Intermittent Issues Another community user reported agent-level webhooks not receiving data during a specific time window, but it resolved itself. [(4) ]() Check if this is consistent or intermittent. ## Questions to Help Narrow Down - Is your n8n webhook URL publicly accessible (not localhost) ? - Are you seeing any calls in your Retell dashboard with completed status? - Can you test the
webhook URL independently with a curl request or webhook.site?
​ To learn more, see the sources I considered: [[1] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[3] Agent-level webhook returning 403 after call_ended](https://discord.com/channels/1186424376300679209/1314024215791276103) [[4] Agent Level Webhook not receiving data](https://discord.com/channels/1186424376300679209/1412776467112263750) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy how do i set information on the custom_analysis_data so it can send over to my webhook when the call is analyzed?
a
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
### Answer To configure custom post-call analysis data that gets sent to your webhook when
call_analyzed
fires, you need to set the
post_call_analysis_data
field on your agent. ## Configure Post-Call Analysis Data on Your Agent You define the fields you want extracted using the
post_call_analysis_data
array when creating or updating your agent. [(1) ]() Here's an example from the Create Voice Agent API:
Copy code
javascript
"post_call_analysis_data": [
  {
    "type": "string",
    "name": "customer_name",
    "description": "The name of the customer.",
    "examples": [
      "John Doe",
      "Jane Smith"
    ]
  }
]
## Available Analysis Types You can extract four types of data: [(2) ]() - Boolean (True/False) – Simple yes/no determinations - Text (String) – Detailed textual information like summaries or action items - Number (Numerical value) – Quantitative measurements - Selector (Enum) – Categorization from a fixed list ## Choose Your Analysis Model You can also set
post_call_analysis_model
to specify which model performs the analysis. The default is
gpt-4.1-mini
. [(1) ]()
Copy code
javascript
"post_call_analysis_model": "gpt-4.1-mini"
## How It Reaches Your Webhook Once configured, when a call ends and analysis completes, the
call_analyzed
webhook event will include your custom analysis results. Make sure your agent-level
webhook_url
is set to receive this event.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Create Voice Agent](https://docs.retellai.com/api-references/create-agent) [[2] Post Call Analysis Overview](https://docs.retellai.com/features/post-call-analysis-overview) ​
m
@AI Evy so how exactly do i update my agent? It's already created. Do i download the json file, add the fields in the array, and then upload it again?
a
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
### Answer To update your existing agent, you use the Update Voice Agent API endpoint. You don't need to download/upload JSON files—you make a PATCH request to the API with only the fields you want to change. [(1) ]() ## Using the SDK (JavaScript)
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', {
  agent_name: 'Jarvis',
}) ;
console.log(agentResponse.agent_id) ;
## To Add Post-Call Analysis Data You'd call
client.agent.update()
with your agent ID and include the
post_call_analysis_data
array:
Copy code
javascript
const agentResponse = await client.agent.update('YOUR_AGENT_ID', {
  post_call_analysis_data: [
    {
      type: 'string',
      name: 'customer_name',
      description: 'The name of the customer.',
      examples: ['John Doe', 'Jane Smith']
    }
  ]
}) ;
## API Endpoint Details - **Method**:
PATCH
- **Path**:
/update-agent/{agent_id}
- **Authorization**: Bearer token with your API key You only need to include the fields you want to update—everything else stays the same. The API updates the agent's latest draft version.
​ To learn more, see the sources I considered: [[1] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.