https://retellai.com/?utm_source=discord&utm_medium=seo logo
is there any way to extract "call_id" during inbou...
# ❓・ai-evy-support
a
is there any way to extract "call_id" during inbound webhook run? @AI Evy
a
Thanks for tagging me @anton333_50203. I'll look through relevant sources and get back to you shortly.
### Answer No, the
call_id
is not available during the inbound webhook execution [(1) ]() . The inbound webhook is triggered before the call is connected and before a call object is created . The documentation explicitly states: "Note that the call is not connected, and a call object is not yet created (and if you decided not to take the call for example, the call object will not be created) . Therefore you will not have a call object and call id inside the payload" . The inbound webhook payload only contains : -
agent_id
(if the number has inbound agent id set) -
from_number
(always present) -
to_number
(always present) To get the
call_id
, you need to use the
call_analyzed
webhook instead, which is triggered after the call completes and contains the full call data including the
call_id
[(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[3] Inbound Call issues](https://discord.com/channels/1186424376300679209/1400852237428723763) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
So what and how would be the soonest I can get that call id?
So what and how would be the soonest I can get that call id? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer The soonest you can get the
call_id
is through the
call_started
webhook event [(1) ]() . This webhook is triggered when a new call begins and includes basic call information . The
call_started
webhook payload contains the
call_id
field . Here's the structure you'll receive:
Copy code
json
{
 "event": "call_started",
 "call": {
 "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 // other basic call information
 }
}
However, there's an important caveat: if the call did not connect (like dial failed) , the
call_started
webhook event will not be triggered . In cases where calls have disconnection reasons like
dial_failed
,
dial_no_answer
, or
dial_busy
, you'll only receive the
call_ended
and
call_analyzed
webhook events . For calls that do connect successfully, the
call_started
webhook gives you the earliest access to the
call_id
.
​ To learn more, see the sources I considered: [[1] 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.
a
When is called_started webhook is triggered? Is it through agent-level webhook?
When is called_started webhook is triggered? Is it through agent-level webhook? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer The
call_started
webhook is triggered when a new call begins [(1) ]() . Yes, it can be triggered through agent-level webhooks [(1) ]() [(2) ]() [(3) ]() . You can configure agent-level webhooks by setting the
webhook_url
parameter when creating or updating an agent [(2) ]() [(3) ]() . When you set a webhook URL at the agent level, it will receive all webhook events for that specific agent, including
call_started
,
call_ended
, and
call_analyzed
events [(1) ]() . The agent-level webhook configuration binds webhook events for that specific agent to the specified URL and will ignore the account-level webhook for that agent [(2) ]() [(3) ]() . As mentioned in the Discord discussion, the webhook will always fire for all three events (call started, call ended, and call analyzed) [(4) ]() . If you only want to handle specific events, you would need to filter them in your webhook handler rather than preventing Retell AI from sending them .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Update Agent](https://docs.retellai.com/api-references/update-agent) [[4] How to trigger Agent-level Webhook only when call has ended?](https://discord.com/channels/1186424376300679209/1270019654718459905) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Hmm... but as I analyse my executions I can see that all 3 (call_started, call_ended, and call_analyzed) events are only coming through after the call was ended. The call_started isn't triggered at the start of the call @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer [(1) ]() That behavior is unexpected based on the official documentation. According to the webhook specification, the
call_started
webhook should be triggered when a new call begins, not after it ends . The documentation states that webhooks are triggered in order but are not blocking - meaning if the
call_started
webhook fails, the system can still trigger
call_ended
and
call_analyzed
webhooks . However, all three should be triggered at their appropriate times during the call lifecycle. The webhook specification indicates that the webhook will
POST
the payload to your endpoint with a timeout of 10 seconds, and if no success status (2xx) is received within that timeframe, it will be retried up to 3 times . A few things to check: 1. **Webhook endpoint response**: Ensure your webhook endpoint is returning a successful status code (2xx) within 10 seconds for the
call_started
event 2. **Network connectivity**: Verify your webhook endpoint is reachable when the call starts 3. **Call connection status**: The
call_started
webhook will not be triggered if the call did not connect (like calls with
dial_failed
,
dial_no_answer
,
dial_busy
disconnection reasons) If your calls are connecting successfully but you're still not receiving
call_started
webhooks in real-time, this appears to be a technical issue that would require investigation by the Retell AI team. For support with this webhook timing issue, I recommend: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] 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.
l
@AI Evy my inbound webhook is not functioning. I think there is something on retells end
a
Thanks for the follow-up, @lathe_38179. I'll get back to you soon.
### Answer Let me help you troubleshoot your inbound webhook issue. Based on the available sources, there are several known issues and troubleshooting steps for inbound webhooks. ## Common Inbound Webhook Issues **Webhook URL Saving Problems**: There's a documented issue where the inbound webhook URL may fail to save or stay saved [(1) ]() . This appears to be related to compatibility issues with conversation flow agents - if you save an agent after adding a webhook URL to the phone number, the webhook on the phone number can be lost . **Error_inbound_webhook**: Users have reported experiencing "Error_inbound_webhook" errors that can arise randomly, even after the webhook was working previously [(2) ]() . In these cases, the issue may be related to your webhook endpoint configuration rather than Retell's side . ## Troubleshooting Steps 1. **Check Webhook Response**: When your inbound webhook receives a request, it must respond with a 200 status code [(3) ]() . If you want to accept the call, include
"call_inbound.override_agent_id"
in your JSON response. If you want to reject the call, respond with 200 status without the override agent ID . 2. **Verify Webhook Retry Logic**: If your webhook doesn't respond successfully, it will be retried up to 3 times . If all attempts fail and the phone number has an inbound agent ID set, it will try to connect to that agent. Otherwise, it will disconnect the call . 3. **Test Your Endpoint**: Set up a test endpoint locally and verify it's responding correctly [(4) ]() . You can test using this curl command structure:
Copy code
bash
curl --location 'localhost:8080/webhook' \
--header 'Content-Type: application/json' \
--data '{
 "event": "call_ended",
 "call": {
 "call_type": "phone_call",
 "from_number": "+12137771234",
 "to_number": "+12137771235",
 "direction": "inbound",
 "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "call_status": "registered",
 "metadata": {},
 "retell_llm_dynamic_variables": {
 "customer_name": "John Doe"
 },
 "start_timestamp": 1714608475945,
 "end_timestamp": 1714608491736,
 "disconnection_reason": "user_hangup",
 "transcript": "...",
 "opt_out_sensitive_data_storage": false
 }
}'
4. **Agent Compatibility**: Ensure you're not using both inbound webhooks and conversation flow agent webhooks simultaneously, as this can cause conflicts [(1) ]() . If these steps don't resolve the issue, it may require direct support investigation. For technical issues like this, I recommend: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] inbound webhook URL failing to save (or stay saved) and wont work together with conversation agaent](https://discord.com/channels/1186424376300679209/1398428473781125314) [[2] New issue "Error_inbound_webhook" randomly started arising!](https://discord.com/channels/1186424376300679209/1334519439038742589) [[3] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[4] Setup guide](https://docs.retellai.com/features/register-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Quick unrelated question when instructing the agent to collect certain details do I need to phrase them like this: "Ask what name they would like to use for the booking and store it {{user_name}}" Do I actually need that part "... and store it in {{user_name}}", or does the agent understand where to store it without it? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, dynamic variables in Retell AI are placeholders that allow you to inject data into various parts of the agent for specific calls [(1) ]() . However, the documentation doesn't provide specific information about whether you need to explicitly instruct the agent to store collected information in dynamic variables like
{{user_name}}
. The sources show that dynamic variables use the double curly brace syntax (e.g.,
{{user_name}}
) and can be used in prompts, begin messages, and other agent configurations . For outbound calls, you set variables in the
retell_llm_dynamic_variables
field, and for inbound calls, you can supply them through the Inbound Call Webhook . The documentation also mentions that when a dynamic variable is not assigned a value, it will remain unchanged in the output in its raw form (
{{variable_name}}
) rather than being replaced . However, the sources don't specifically address whether explicit storage instructions are required in prompts for the agent to understand where to store collected information. For this specific question about prompt phrasing and variable storage instructions, I'd recommend: Check out these potentially useful sources: - [Dynamic Variables]() - [Contact Sales]() - [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.