We are attempting to automate outbound calls from our Terraform-managed infrastructure using the Genesys Cloud API. The goal is to initiate a call on behalf of a specific agent without requiring manual intervention in the PureCloud client. We are using the POST /api/v2/conversations/calls endpoint with a valid Bearer token obtained via client credentials flow.
Here is the JSON payload we are sending:
{
"to": {
"phoneNumber": "+491234567890"
},
"from": {
"phoneNumber": "+499876543210"
},
"route": {
"type": "user",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
The request consistently returns a 409 Conflict status code. The error response body contains the following message:
{
"code": "conflict",
"message": "The user is currently in a conversation or not available for outbound calls."
}
We have verified that the user ID belongs to an agent who is currently in the “Available” state and not engaged in any active conversations. The agent’s profile has the necessary permissions for making outbound calls. We are running this from a backend service in the Europe/Berlin timezone, but the API calls are hitting the mypurecloud.com endpoint correctly. We’ve checked the user’s state via the /api/v2/users/{userId}/state endpoint, and it confirms they are available. Is there a specific configuration in the user’s routing profile or a hidden state lock that we are missing? The Terraform provider does not expose a direct resource for this action, so we are relying on the raw API call within our provisioner scripts.