I’m trying to transfer an active voice conversation to a specific queue programmatically using the Node.js SDK (genesys-cloud-nodejs-client). The docs say I can use PATCH /api/v2/conversations/{conversationId}/participants with a transferTo object in the body.
Here’s the code I’m running:
const participantId = 'some-participant-id';
const conversationId = 'some-conversation-id';
const body = {
transferTo: {
type: 'queue',
id: 'my-queue-id-123'
}
};
try {
const response = await apiInstance.patchConversationVoiceParticipant(
conversationId,
participantId,
body
);
console.log('Transfer initiated:', response);
} catch (error) {
console.error('Error:', error.response.status, error.response.data);
}
The request throws a 400 Bad Request. The error payload looks like this:
{
"message": "Validation failed",
"errors": [
{
"message": "transferTo.id is required when transferTo.type is queue"
}
]
}
I’m passing the ID explicitly. I’ve double-checked that my-queue-id-123 exists and is active. I’ve also tried passing just the object without the type field, but that gives a different validation error saying type is required.
Is there a specific format for the id that I’m missing? Or does this endpoint actually not support queue transfers directly and I need to hit the routing API first? The SDK method seems to imply it should work.