Building a custom softphone overlay for our agents. We need a programmatic way to toggle the microphone mute state on the current conversation without triggering the UI mute button. The goal is to keep the agent in the call but suppress their audio feed to the customer while they consult with a supervisor or check notes.
I’ve been digging through the NICE CXone Platform SDK (JavaScript) documentation for the conversations API. I found the endpoint PATCH /api/v2/conversations/web/{conversationId} which accepts a mute boolean in the body. Here is the code I’m testing in the browser console:
const client = platformClient;
const conversationId = 'abc-123-def';
client.conversationsApi.postConversationsWeb(conversationId, {
mute: true
}).then((response) => {
console.log('Mute successful', response);
}).catch((error) => {
console.error('Mute failed', error);
});
The request returns a 200 OK status, which is promising. However, the agent’s microphone isn’t actually muting on the client side. The customer can still hear them. I checked the WebSocket events for conversation:update and the muted field is flipping correctly in the payload, but the audio stream persists.
I also tried using the sessions API to mute the specific media stream, but that requires knowing the exact sessionId and mediaId which changes dynamically. Is there a specific flag I’m missing in the PATCH body? Maybe hold needs to be set to true as well? Or is there a different SDK method for local mute vs remote mute that I’m overlooking?
We’re on the latest SDK version. Any pointers would be appreciated.