Trying to trigger an outbound call from a script using the REST Proxy. The goal is to let an agent initiate a call to a customer without manually dialing. I’m using the standard POST endpoint with the agent’s ID and the destination number. The auth token is valid and comes from the session context. Here’s the body I’m sending:
{
“toContact”: {“phoneNumber”: “+15550199”},
“fromContact”: {“phoneNumber”: “+15550100”},
“wrapUpCode”: “Transfer”,
“queueId”: “abc-123”
}
The response is a 403 Forbidden with message “Agent is not in a conversation”. This happens even when the agent is idle and available. I’ve confirmed the queue ID is correct and the agent has the right permissions. I’ve also tried omitting the wrapUpCode, but the result is the same. The docs say the agent must be in a conversation, but that seems circular if we’re trying to start one.
Is there a way to bypass this requirement? Or should I be using a different endpoint? I’ve checked the SDK examples but they all assume the agent is already in a call or transfer flow.
You’re hitting a 403 because that endpoint doesn’t work the way you think it does. You can’t just POST to /conversations/calls to spawn a new outbound leg from thin air. That endpoint is for creating or updating existing conversations, not initiating outbound dialing. The system rejects it because the agent isn’t already in a conversation state that allows this specific modification, or the permissions for creating a conversation from scratch via that path are restricted.
If you want an agent to trigger an outbound call from a script, you need to use the Telephony vider API or the specific Outbound Campaign APIs if it’s predictive. But for a simple “agent clicks button, calls customer” flow, the standard way is using the POST /api/v2/telephony/viders/edge/phonecalls endpoint. Wait, actually, that’s for CTI. If you’re strictly inside Architect or a script context, you should be using the Make Call flow action or the REST xy pointing to /api/v2/telephony/viders/edge/phonecalls with the correct body.
Here’s what the body actually needs to look like for the edge vider call:
{
"fromContact": {
"phoneNumber": "+15550100",
"name": "Agent Line"
},
"toContact": {
"phoneNumber": "+15550199",
"name": "Customer"
},
"viderEdgeId": "your-edge-id-here",
"callType": "outbound"
}
The viderEdgeId is crucial. You get that from your org’s telephony vider setup. Without it, the API doesn’t know which hardware or SIP trunk to use. Also, make sure the auth token has the telephony:phonecalls scope. Just passing a generic user token often fails here because the scope is too broad or missing that specific permission.
Check your Edge ID first. If that’s wrong, you’ll get a 400 or 403 depending on how the gateway handles the lookup.