{
"error_code": "bad_request",
"message": "The request body was malformed or the address is invalid."
}
Hit a wall trying to programmatically initiate outbound calls via the Node.js SDK. The docs say the to address in the participants array should just be a string, but I keep getting a 400. We’re using genesys-cloud-node-sdk@2.28.0 and running this inside an AWS Lambda (Node 18).
Here’s the payload I’m sending to POST /api/v2/conversations/calls:
const createCallRequest = {
from: {
phoneNumber: "+1234567890",
name: "Test Bot"
},
to: {
phoneNumber: "+0987654321",
name: "Customer"
},
participants: [
{
fromAddress: "+1234567890",
toAddress: "+0987654321"
}
]
};
I’ve tried swapping toAddress for just a raw string "+0987654321" in the participants array, but the SDK’s type definitions are strict and it blows up at compile time if I don’t pass an object. The from and to top-level fields seem fine since they match the example in the Swagger UI.
Is the participants array even required for a simple outbound call? The API spec lists it as optional, but when I omit it entirely, I get a different 400 error saying participants cannot be empty.
Also, noticed that the from object needs a name field in some versions of the API. Is that causing the parser to choke on the address format? The phone numbers are definitely E.164 compliant. I’ve validated them with a regex before sending.
Feels like there’s a mismatch between the SDK’s generated types and what the actual REST endpoint expects for the participants schema. Anyone else hit this when using the JS SDK for call creation?