Mute/Unmute Microsoft Teams Microphone Using Mouse Button when Teams is Not Focused
here is an API call using graph, that does something like you are asking.
https://docs.microsoft.com/en-us/graph/api/resources/participant?view=graph-rest-1.0&amp;viewFallbackFrom=graph-rest-v1.0#properties
They also have an API call to mute
https://docs.microsoft.com/en-us/graph/api/participant-mute?view=graph-rest-1.0&amp;tabs=http
However I don't think you are going to get the feature you want, because when you are using teams, you are not allowed to unmute someone else, and the API has no idea the person you would be trying to unmute, is you.
One thing that should be pretty easy, is to mute/unmute the mic at the operating system level. This would work, however your co-workers would not know you are muted.