https://retellai.com/?utm_source=discord&utm_medium=seo logo
I am creating a custom function
# ❓・ai-evy-support
d
@AI Evy I am creating a custom function. I want to understand the callData schema that retell can share along with the argschema. What is the schema design for the callData that is shared? Is it the same for both inbound/outbound calls ?
a
Thanks for tagging me @dharmilshah_31046. I'll look through relevant sources and get back to you shortly.
### Answer When Retell calls your custom function endpoint, it passes a
call
object along with your function's arguments. [(1) ]() The structure includes:
Copy code
json
{
  "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"
    },
    "opt_out_sensitive_data_storage": true
  },
  "name": "get_weather",
  "args": {
    "city": "New York"
  }
}
The
call
field contains the call metadata, allowing you to access
from_number
and
to_number
within your custom function. The
direction
field indicates whether it's an "inbound" or "outbound" call. Based on the available sources, this schema structure appears consistent for both inbound and outbound calls, with the
direction
field differentiating between them.
​ To learn more, see the sources I considered: [[1] Discord message from @kevinstonepdx on 2024-11-19](https://discord.com/channels/1186424376300679209/1294891368505937952/1308309042640453692) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.