409 Conflict on POST /api/v2/conversations/calls when initiating outbound calls via Python SDK

We are working on a script to initiate outbound calls on behalf of agents using the Genesys Cloud Python SDK. The goal is to trigger the call from our backend system rather than the agent’s desktop. We are using the POST /api/v2/conversations/calls endpoint.

The script authenticates correctly and retrieves the agent’s user ID. However, when we attempt to create the conversation, we receive a 409 Conflict error. The error payload indicates that the requested operation is not allowed for the specified user state.

Here is the relevant portion of the code:

from genesyscloud.platform.client import PlatformClient
from genesyscloud.conversations.api import conversations_api

client = PlatformClient.create_from_config_file('genesys_config.json')
api = conversations_api.ConversationsApi(client)

request_body = {
 "type": "outbound",
 "from": {
 "phoneNumber": "+15551234567",
 "name": "System Outbound"
 },
 "to": [
 {
 "phoneNumber": "+15559876543",
 "name": "Customer"
 }
 ],
 "wrapUpCode": {
 "id": "some-wrapup-id"
 },
 "owner": {
 "id": "agent-user-id-123",
 "type": "user"
 },
 "initialState": "ringing"
}

try:
 response = api.post_conversations_calls(body=request_body)
 print("Call initiated:", response)
except Exception as e:
 print(f"Error: {e}")

The error response looks like this:

{
 "code": "conflict",
 "message": "The requested operation is not allowed for the specified user state.",
 "status": 409
}

We have verified that the agent user has the necessary permissions for conversation:call:write. The agent is currently in a “Available” state. We are wondering if there is a specific condition regarding the agent’s state or the initialState field that we are missing. The documentation mentions that the owner field is required for outbound calls, but it does not explicitly state whether the agent must be in a specific state to accept an externally initiated call.

We have also tried setting the initialState to connected, but that results in a 400 Bad Request because the call has not yet been established. We are looking for the correct way to initiate this call so that it rings the customer and associates with the agent immediately.