I’m trying to programmatically initiate an outbound call from our WFM adherence tool to a specific agent for a quick check-in. I’m using the Genesys Cloud REST API endpoint /api/v2/conversations/calls with a simple JSON payload.
The request keeps failing with a 400 Bad Request. The error message in the response body says:
{
"errors": [
{
"code": "malformedParticipantAddress",
"message": "The participant address is not valid."
}
]
}
Here’s the Python code I’m using to make the request. I’m passing the agent’s user ID directly into the to field as a person type.
import requests
import json
headers = {
'Authorization': 'Bearer <my_token>',
'Content-Type': 'application/json'
}
payload = {
"from": {
"phoneNumber": "+15550001234",
"type": "phone"
},
"to": {
"id": "agent-user-id-12345",
"type": "person"
}
}
response = requests.post(
'https://api.mypurecloud.com/api/v2/conversations/calls',
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
I’ve double-checked that the token is valid and has the conversation:write scope. The phone number in from is definitely a valid DID in our account. Is the to structure wrong? I thought passing the user ID as type: person was the standard way to target an internal extension or agent.
Also, I’m in US/Central time if that matters for any timestamp issues, though I don’t see timestamps in this payload.
Any ideas what I’m missing here?