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?