Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Based on your description, I have conducted some research, and the below information might help
1/ Does Microsoft Teams or Microsoft Graph API support forcibly ending a meeting for all participants?
Unfortunately, No, currently Microsoft Teams and the Microsoft Graph API do not provide any endpoint that forcibly terminates an active meeting session and removes all current participants simultaneously. The endDateTime property on the onlineMeeting resource is used for scheduling purposes only and carries no enforcement behavior once the meeting is in progress.
As states in: onlineMeeting resource type
2/ Is there any session timeout or policy setting available for Teams meetings?
As far as I know, there is a tenant-level or per-user meeting policy available through the Microsoft Teams PowerShell module that can be configured to automatically end a meeting after a period of inactivity. This is managed via Set-CsTeamsMeetingPolicy and requires Teams Administrator privileges. However, this policy applies uniformly and cannot be configured on a per-meeting basis through the Graph API.
You can read here for more information: Set-CsTeamsMeetingPolicy | Manage meeting policies
3/ Are there any recommended approaches to enforce meeting duration?
Yes, in my opinion, you can try deploying a Teams bot that joins the meeting as a participant using the Cloud Communications API by following below instructions:
- Register a bot via Azure Bot Framework
- Join the meeting programmatically using
POST /communications/calls
- When the timer expires, the bot calls:
DELETE /communications/calls/{call-id}
This will ends the call from the bot's perspective (which acts as host/organizer), and terminates the session for all participants if the bot is the meeting organizer.
Note: The bot must join as the meeting organizer (using application permissions and the organizer's identity), not as a regular attendee. If the bot only joins as a guest, deleting its own leg does not end the meeting for others.
Graph API call to end the call:
DELETE https://graph.microsoft.com/v1.0/communications/calls/{call-id}
Hope my answer will help you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.