Hey team,
I’m working on a custom client-side widget for our internal dashboard. We want to give supervisors a quick way to mute an agent’s microphone during a live call without ending the interaction. I’m using the Genesys Cloud Platform SDK for JavaScript (genesys-cloud-platform-client-sdk-js).
I’ve initialized the client and can successfully retrieve the active conversation using api.getConversation(). The response gives me the conversation ID and the specific participant details. I can see the isMuted property in the participant object, but it’s read-only in the response.
My assumption is that I need to use the updateConversationParticipant method to change this state. Here’s the code snippet I’m testing:
const participantId = activeConversation.participants[0].id;
const body = {
isMuted: true
};
try {
const response = await conversationApi.updateConversationParticipant(
activeConversation.id,
participantId,
body
);
console.log('Mute successful', response);
} catch (error) {
console.error('Failed to mute', error);
}
When I run this, I get a 400 Bad Request error. The error message says: "The request was invalid.". I’ve double-checked the conversation ID and participant ID, and they match what’s returned in the GET call.
I also tried setting isMuted to false to unmute, but same result. I’m not sure if I need to include other fields in the body like muted or if there’s a specific permission I’m missing. The agent has the conversation:participant:update permission in the role I’m testing with.
Is there a different endpoint or method I should be using for this? Or is my payload structure wrong? I’ve looked at the OpenAPI spec but it’s a bit dense for this specific use case.