Trying to kick a single participant out of an active conference call using the Genesys Cloud JavaScript SDK. The docs point to the patchConversation endpoint, but I can’t get the participant removal to stick. I’m constructing a ConversationPatch object with the participants array, removing the target user’s ID, and sending it via conversationsApi.patchConversation(conversationId, patchRequest). The request returns a 200 OK, but the participant stays in the call. Checked the response body, and the participant list looks correct without the user, yet the actual call state doesn’t update.
Here’s the code snippet I’m using:
const patchRequest = new ConversationPatch();
const participants = conversation.participants.filter(p => p.id !== targetParticipantId);
patchRequest.participants = participants;
try {
const result = await conversationsApi.patchConversation(conversationId, patchRequest);
console.log('Patch successful:', result);
} catch (error) {
console.error('Failed to patch conversation:', error);
}
I’ve verified the conversationId and targetParticipantId are correct by logging the initial getConversation response. The API call succeeds without errors, but the participant remains connected. I’ve also tried using the deleteConversationParticipant endpoint directly with a DELETE request to /api/v2/conversations/{conversationId}/participants/{participantId}, but that returns a 405 Method Not Allowed.
Is there a specific flag or additional parameter needed in the ConversationPatch to force participant removal? Or is the patchConversation endpoint not the right approach for mid-call participant management? The SDK’s type definitions don’t show any obvious options for this scenario. Also tried adding a reason field to the patch request, but that didn’t help either. Any insights on how to properly disconnect a participant mid-call using the JS SDK would be appreciated. The documentation is a bit sparse on real-time call control operations.