Trying to transfer an active call to a queue via the JS SDK. The docs say to PATCH the conversation with a to object, but the server keeps rejecting it with a 422 Unprocessable Entity. No validation error details in the response body, just empty.
await client.telephonyPhoneCallsApi.patchTelephonyPhoneCallsCallId(callId, {
to: [
{
id: 'queue-id-123',
type: 'queue'
}
]
});
The call is active, the queue exists, and I have the right scopes. Tried adding mediaType and routingType to the payload, same result. Is the SDK serializing the to array incorrectly for this endpoint?
You’re hitting a common gotcha with the Telephony API. The to parameter expects a TargetAddress object, not just an ID and type. The JS SDK is strict about the schema, and omitting the address field causes that silent 422.
Try restructuring the payload to include the actual identifier in the address field. Also, make sure you’re using the correct scope. You need telephony:phone-calls:write on the access token.
await client.telephonyPhoneCallsApi.patchTelephonyPhoneCallsCallId(callId, {
to: [{
address: 'queue-id-123', // This is the missing piece
type: 'queue'
}]
});
Double check that the queue ID is correct. If it’s still failing, check the browser network tab for the raw request body. Sometimes the SDK serializes nested objects differently than you expect. I’ve seen this trip up teams when migrating from older wrapper versions.