Teams v1.6+ (https://techcommunity.microsoft.com/t5/microsoft-teams-blog/delivering-new-webinar-experiences-with-microsoft-teams/ba-p/3725145) has a websocket API that can be used for third parties to connect to Teams and get information about and manage calls. It’s first used in the Stream Deck Plugin.

The content of this page is quick and dirty reverse engineered to document the possible API calls. This is not likely not complete, but it works!

Connect to websocket:

ws://localhost:8124?token=API-TOKEN-FROM-PRIVACY&protocol-version=1.0.0&manufacturer=MuteDeck&device=MuteDeck&app=MuteDeck&app-version=1.4

How to get an API token: https://support.microsoft.com/en-us/office/connect-third-party-devices-to-teams-aabca9f2-47bb-407f-9f9b-81a104a883d6

Get meeting status [to Teams]:

{"apiVersion":"1.0.0","service":"query-meeting-state","action":"query-meeting-state","manufacturer":"Elgato","device":"StreamDeck","timestamp":1675341655453}

Meeting status update [from Teams]:

{"apiVersion":"1.0.0","meetingUpdate":{"meetingState":{"isMuted":false,"isCameraOn":true,"isHandRaised":false,"isInMeeting":false,"isRecordingOn":false,"isBackgroundBlurred":false},"meetingPermissions":{"canToggleMute":false,"canToggleVideo":true,"canToggleHand":false,"canToggleBlur":false,"canToggleRecord":false,"canLeave":false,"canReact":false}}}

Toggling Mute [to Teams]:

{"apiVersion":"1.0.0","service":"toggle-mute","action":"toggle-mute","manufacturer":"Elgato","device":"StreamDeck","timestamp":1675341775725}

Toggling Video [to Teams]:

{"apiVersion":"1.0.0","service":"toggle-video","action":"toggle-video","manufacturer":"Elgato","device":"StreamDeck","timestamp":1675341791249}

Toggling Recording [to Teams]: (Microsoft removed this call)

~~{"apiVersion":"1.0.0","service":"recording","action":"toggle-recording","manufacturer":"Elgato","device":"StreamDeck","timestamp":1675341818496}~~

Leave meeting [to Teams]:

{"apiVersion":"1.0.0","service":"call","action":"leave-call","manufacturer":"Elgato","device":"StreamDeck","timestamp":1675341849778}