Is there a clean way to mute or unmute an agent’s microphone programmatically using the Genesys Cloud JavaScript SDK during an active voice call?
I am building a security automation layer that needs to enforce audio silence based on external risk signals. I have the interactionId and participantId from the webhook payload, but I cannot find a direct method in the Call object or the InteractionsApi to toggle the mute state.
I attempted to use the PATCH endpoint for attributes, but it seems to only handle metadata, not media control. I also tried calling call.mute() on the local participant, but that only mutes the local client, not the agent’s stream in the conference.
Here is my current attempt using the SDK:
const interactions = platformClient.interactions;
await interactions.patchInteractionsAttributes(interactionId, {
attributes: {
muted: true
}
});
This returns a 200 OK but the agent’s audio is not muted on the other end. Is there a specific REST API call or SDK method I am missing to control the media stream for a remote participant?