PATCH /conversations/voice/{conversationId} transfer to queue fails with 400

Trying to program a call transfer to a specific queue using the JS SDK. The patchVoiceConversation endpoint seems like the right call, but the payload keeps getting rejected.

Here’s the snippet:

const patchBody = {
 actions: [
 {
 type: "transfer",
 to: {
 targetType: "queue",
 targetId: "abc-123-queue-id"
 }
 }
 ]
};
await client.conversationsApi.patchVoiceConversation(conversationId, patchBody);

The API returns a 400 Bad Request. The error message is generic: “Invalid request body.” I’ve double-checked the targetId and it’s a valid queue UUID. The docs for v2 are sparse on the exact structure for the actions array when doing a transfer via PATCH. Is the targetType value case-sensitive? Or am I missing a required field in the action object? The SDK types don’t enforce much here, so it’s easy to miss something subtle. The to object feels incomplete. What’s the missing piece?

1 Like

That endpoint won’t work for queue transfers. You need to use the specific voice participant API instead. Try patchVoiceConversationParticipant with a transfer action targeting the queue ID. The conversation-level patch is too generic for this.

await client.conversationsApi.patchVoiceConversationParticipant(conversationId, participantId, {
 actions: [{ type: "transfer", to: { targetType: "queue", targetId: queueId } }]
});

is spot on. You need to target the participant, not the conversation, so use patchVoiceConversationParticipant with that exact action structure. Just make sure you have the conversation:write scope.

2 Likes