I’m running into a weird validation issue when trying to initiate outbound calls via the Genesys Cloud API. I need these calls to trigger specific OpenTelemetry spans in our downstream Data Actions, so the payload structure is strict.
The endpoint is POST /api/v2/conversations/calls. I’m sending a standard call object with a valid E.164 destination number. The number passes our local regex checks (it looks like +15551234567), and it works fine in the GUI.
Here is the JSON body I’m sending:
{
"to": {
"phoneNumber": "+15551234567",
"type": "phoneNumber"
},
"from": {
"phoneNumber": "+18005550199",
"type": "phoneNumber"
},
"wrapUpCode": "default"
}
The API responds with a 400 Bad Request. The error message in the body is:
{
"message": "Malformed participant address",
"code": "bad_request",
"status": 400,
"errors": [
"Malformed participant address"
]
}
I’ve tried:
- Removing the
+sign. Still 400. - Adding country code explicitly in a different field structure. Still 400.
- Checking for hidden unicode characters in the string. None found.
My Node.js SDK code looks like this:
const apiInstance = new PlatformClient.ConversationsApi();
const call = new PlatformClient.Call();
call.to = { phoneNumber: "+15551234567", type: "phoneNumber" };
call.from = { phoneNumber: "+18005550199", type: "phoneNumber" };
try {
const data = await apiInstance.postConversationCall(call);
console.log("Call initiated:", data);
} catch (error) {
console.error("Error:", error.message);
}
The trace context is being injected correctly into the headers, so that’s not the issue. Is there a specific format requirement for the phoneNumber field that isn’t documented? I’m on API version 2024-01-01.
What am I missing?