Trying to initiate an outbound call from a script using the REST Proxy action. The goal is to have the system place a call on behalf of the current agent so they can take it over immediately. This is for a specific workflow where we need to bypass the standard outbound campaign logic.
I’m using the endpoint POST /api/v2/conversations/calls. The documentation implies this should work if the token has the right scopes. Here is the JSON payload I’m sending:
{
"to": "+15550199",
"from": "+15550100",
"mediaType": "audio",
"providerId": "my_default_provider",
"wrapUpCode": null,
"routing": {
"type": "agent",
"agentId": "{{agent.id}}"
}
}
The {{agent.id}} variable resolves correctly to a valid UUID in the trace logs. The from number is verified and assigned to the provider. I’ve double-checked the OAuth token scopes attached to the integration. It has conversations:write and conversations:read.
The response is a straight 403 Forbidden. The body is empty, which isn’t helpful.
I tried a few things:
- Swapped the
providerIdfor the UUID of the specific voice provider. Same error. - Removed the
routingblock entirely. The call initiates, but it doesn’t ring the agent. It just sits in the queue or fails to connect. I need it to ring the specific agent. - Checked the trace for the REST Proxy action. The request headers look fine. The Authorization header is present.
Is there a specific scope I’m missing? Or is this endpoint simply blocked when called from within a script context due to some security layer? The docs are vague about server-side vs client-side restrictions for this specific endpoint.
Also, I noticed in the trace that the x-genesys-origin header is set to ``. Could that be causing the rejection? I don’t see any mention of this in the API reference.