https://retellai.com/?utm_source=discord&utm_medium=seo logo
, could I make a webhook call to get a caller name...
# ❓・ai-evy-support
w
@AI Evy , could I make a webhook call to get a caller name and previous call history at the beginning of a call? has this been done and are there any latency concerns? Is there any architecture guidelines ?
a
Thanks for tagging me @wolfgang074778. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can implement caller name and previous call history retrieval at the beginning of calls using Retell AI's webhook system [(1) ]() . While there isn't a direct webhook for the call start, you can use the
call_started
event to trigger your backend logic . For retrieving previous conversation history, you would need to implement conversation history in your backend [(2) ]() . A simple approach would be to use the call summary from the
call_analyzed
webhook, store it associated with the phone number, and then use inbound dynamic variables to supply it as a variable into the agent . The webhook system supports the following event types [(1) ]() : - `call_started`: Triggered when a new call begins with basic call information - `call_ended`: Triggered when a call completes with all call object fields - `call_analyzed`: Triggered when call analysis is complete with full call data including analysis Latency Considerations: The webhook has a timeout of 10 seconds . If no success status (2xx) is received within 10 seconds, the webhook will be retried up to 3 times . For optimal performance, Retell AI is optimized for low-latency performance with end-to-end latency typically under 800ms [(3) ]() . Network requirements for optimal performance include [(4) ]() : - Latency: <150ms end-to-end - Bandwidth: 87-100 Kbps per call - Jitter: <30ms variance Architecture Guidelines: For webhook implementation, ensure your endpoint returns a successful status code (2xx) with no body expected [(1) ](https
://docs.retellai.com/features/webhook-overview) . You can retrieve call recordings through the
call_ended
or
call_analyzed
webhooks, which deliver the same call info as the get call API including the recording URL [(2) ]() . The webhook payload contains the event type and call object with relevant data [(1) ]() . For conversation history, consider implementing a backend system that stores call summaries and uses dynamic variables to inject previous context into new calls [(2) ]() .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Discord message from @archdesignconcept_00787 on 2025-01-20](https://discord.com/channels/1186424376300679209/1294891368505937952/1330819156563464234) [[3] Inside Retell AI Receptionist's Large Language Model Intent Engine: 92% Accuracy and 50% Fewer Unnecessary Escalations](https://www.retellai.com/resources/retell-ai-receptionist-understands-calls-better) [[4] Enterprise VoIP Integration for AI Calling Success | Retell AI | Retell AI](https://www.retellai.com/blog/enterprise-voip-integration-with-ai-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy could you give me an example of a flow where in the beginning of a call a webhook is called to retrieve information?
a
Thanks for the follow-up, @wolfgang074778. I'll get back to you soon.
### Answer Yes, you can retrieve caller information at the beginning of a call using Retell AI's inbound call webhook [(1) ]() . This webhook is triggered before the call connects, allowing you to fetch caller data and set dynamic variables for personalization . Here's the flow: ## 1. Configure Inbound Webhook Set up an inbound webhook URL on your phone number [(2) ]() :
Copy code
json
{
  "inbound_webhook_url": "<https://example.com/inbound-webhook%22>
}
## 2. Webhook Request Structure When an inbound call arrives, Retell sends a
call_inbound
event to your webhook [(1) ]() :
Copy code
json
{
  "event": "call_inbound",
  "call_inbound": {
    "agent_id": "agent_12345",
    "from_number": "+12137771234",
    "to_number": "+12137771235"
  }
}
## 3. Your Webhook Response Your endpoint can fetch caller information using the
from_number
and respond with dynamic variables :
Copy code
json
{
  "call_inbound": {
    "override_agent_id": "agent_12345",
    "override_agent_version": 1,
    "dynamic_variables": {
      "customer_name": "John Doe"
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
## 4. Webhook Specifications - **Timeout**: 10 seconds - **Retries**: Up to 3 times if unsuccessful - **Response**: Must return 2xx status code - **Call State**: Call remains in ringing state until webhook responds ## 5. Fallback Behavior If the webhook fails after retries, Retell checks if the number has an inbound agent ID set . If yes, it connects to that agent; if not, it disconnects the call . This approach allows you to personalize each call based on caller history or CRM data before the conversation begins .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.