I’m trying to programmatically initiate an outbound call via the REST API, specifically POST /api/v2/conversations/calls. The docs state: “The to parameter must be a valid phone number or SIP URI.” I’ve been staring at this payload for twenty minutes and it looks perfectly valid to me. My Node.js service handles the auth token refresh just fine, I’ve verified the scope includes conversation:call:create.
Here is the exact JSON body I’m sending:
{
"from": {
"phoneNumber": "+31201234567"
},
"to": [
{
"phoneNumber": "+442071234567"
}
],
"wrapUpCode": "Completed"
}
The response is a flat 400 Bad Request. The error message is generic: "message": "Malformed participant address". I’ve tried switching the from number to a generic +1 prefix, I’ve tried removing the country code from the to array, I’ve even tried using the SIP type explicitly. Nothing works. The docs state: “Phone numbers must be in E.164 format.” Both numbers are in E.164. I’ve validated them with a separate regex library and they pass.
I’m using the standard fetch API in Node 18. The headers include Content-Type: application/json and the Authorization: Bearer <token>. I can successfully call GET /api/v2/users/me with the same token, so the auth isn’t the issue. Is there a hidden requirement for the from address regarding the specific user ID associated with the token? The docs don’t mention linking the from number to the authenticated user’s profile, but maybe that’s implied? I’ve checked the user’s profile in the UI and the phone number is listed there. Still failing. What am I missing?