https://retellai.com/?utm_source=discord&utm_medium=seo logo
Webhook Changes - Agent Swapping
# 📒・feature-requests
c
Ive been doing some work. We have an agent for our inbound calls and we're going to be doing outbound calls using a different agent. We're currently using another number for the outbound calls because we dont want to hurt the reputation on the inbound caller number as I know phone number health is important (years of working with a call centre) What would be really useful in the call_analyzed is that we can see under the tool_calls key that there is an array on various tools that were called. When it's in agent swap, you get something like
Copy code
{
  "event": "call_analyzed",
  "call": {
  ...
  "tool_calls": [
    {
      "tool_call_id": "agent_swap_bf8a65",
      "name": "agent_swap",
      "type": "agent_swap",
      "start_time_sec": 0.072,
      "latency_ms": 21.000000000000004,
      "success": true
    }
  ],
  ...
}
This is great but could we add the agent's id (agent_1234567) and the agent's name (Inbound Agent). This will let us know which agent is transferred it to. Result:
Copy code
{
  "event": "call_analyzed",
  "call": {
  ...
  "tool_calls": [
    {
      "tool_call_id": "agent_swap_bf8a65",
      "name": "agent_swap",
      "type": "agent_swap",
      "start_time_sec": 0.072,
      "latency_ms": 21.000000000000004,
      "success": true,
      "agent_id": "agent_1234567",
      "agent_name": "Inbound Agent"
    }
  ],
  ...
}
If you need a call_id, I can more than happy supply with you one.