I’ve spent hours trying to figure out why the Genesys Cloud API is rejecting my outbound call initiation request with a 400 Bad Request. I am trying to programmatically start a call on behalf of an agent using the Conversations API, specifically POST /api/v2/conversations/calls. This is part of a Pulumi TypeScript IaC workflow where we provision the org structure and then need to trigger test calls to validate routing logic.
The documentation suggests the payload should be straightforward, but I keep hitting this wall. Here is the exact JSON body I am sending:
{
"from": {
"phoneNumber": "+442071234567"
},
"to": {
"phoneNumber": "+447911123456"
},
"type": "outbound",
"wrapUpCode": {
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
}
}
The headers include Content-Type: application/json and a valid OAuth2 bearer token with the conversations:call:write scope. I have verified the token works fine for other GET requests on /api/v2/users/me. The phone numbers are formatted correctly as E.164 strings, which I have confirmed are valid in the platform’s number management console.
The response body is minimal and unhelpful:
{
"code": "bad_request",
"message": "Invalid request body",
"status": 400
}
I have tried removing the wrapUpCode object, assuming it might be optional or incorrectly formatted, but the error persists. I have also tried swapping the from and to objects, though that makes no logical sense for an outbound call. Is there a hidden validation rule for the from number that requires it to be a specific type of line (e.g., toll-free vs. local)? Or is the API expecting a different structure for the type field? I am running this from a London-based CI/CD pipeline, so timezone issues are ruled out. Any insights on what specific field is causing this 400 error would be appreciated. I am stuck and the API docs are silent on this specific failure mode.