сontrolUrl for agent redirection
# support
k
I found such an example in the documentation how to forward a call to a number using controlUrl. But how to forward to another AI agent via controlUrl?
Copy code
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' 
-H 'content-type: application/json' 
--data-raw '{
  "type": "transfer",
  "destination": {
    "type": "number",
    "number": "+1234567890"
  },
  "content": "Transferring your call now"
}'
v
Currently, the Vapi documentation does not support transferring a call to another AI agent via the
controlUrl
with a POST request.
Instead, use the Squads feature to configure agent-to-agent transfers. For example, set up your squad and specify assistant destinations in your call initiation payload:
Copy code
json
{
  "squad": {
    "members": [
      {
        "assistantId": "main-assistant-id",
        "assistantDestinations": [
          {
            "type": "assistant",
            "assistantName": "NextAgent",
            "message": "Transferring you to our specialist."
          }
        ]
      }
    ]
  }
}
For more details, see the [Squads documentation](https://docs.vapi.ai/squads) and [Silent Transfers guide](https://docs.vapi.ai/squads/silent-transfers). Sources: - [Squads](https://docs.vapi.ai/squads) - [Silent Transfers](https://docs.vapi.ai/squads/silent-transfers)
c
Hello, The controlUrl works for agent redirection:** 1. Control URL Usage:
Copy code
{
  "type": "transfer",
  "destination": {
    "type": "number",
    "number": "+1234567890"
  },
  "content": "Transferring your call now"
}
2. The controlUrl is obtained when initiating a call:
Copy code
{
  "monitor": {
    "controlUrl": "https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/{call-id}/control",
    "listenUrl": "wss://..."
  }
}
3. For agent redirection: - The URL must be active and valid - The call must be in progress - You need proper permissions to transfer to another AI agent using controlUrl[1](https://docs.vapi.ai/calls/call-features), you'll need to modify the destination type and include the assistant ID:
Copy code
{  "type": "transfer",  "destination": {    "type": "assistant",    "assistantId": "your-assistant-id"  // ID of the target AI assistant  },  "content": "Transferring you to another assistant now"}
So your curl command would be:
Copy code
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/<call-id>/control' \-H 'content-type: application/json' \--data-raw '{  "type": "transfer",  "destination": {    "type": "assistant",    "assistantId": "target-assistant-id"  },  "content": "Transferring you to another assistant now"}'
The transfer will: 1. Play the content message (if provided) 2. Transfer the call to the specified assistant 3. Continue the conversation with the new assistant
4 Views