Forum Discussion
chrisfellows
May 19, 2023Copper Contributor
How to programmatically delete chat recordings and uploaded files
For a group of AD users in my organization then my server application (Dot Net Core, C#) needs to programmatically delete chat recordings and chat files that are older than 30 days. It only applies to 1 to 1 chats and group chats. Not chats in channels.
Could someone point me in the correct direction of where to start?
Which Graph API endpoints would I use?
Am I likely to experience any obvious technical issues in what I'm trying to do?
- Sayali-MSFT
Microsoft
chrisfellows -There are two new API endpoints that developers can now use when working with Microsoft Teams chat messages.
A new method has been added to “soft delete” messages. which can now programmatically be done on any of one of:
- One-to-one or group chats
- channel chats
- replies to chat messages
POST /users/{userId}/chats/{chatsId}/messages/{chatMessageId}/softDelete
Important note: this call is only for delegated permissions right now. There are no application permissions for these calls.
Reference Document-chatMessage: softDelete - Microsoft Graph v1.0 | Microsoft Learn
- chrisfellowsCopper ContributorI don't need to delete messages or chats. I need to delete recordings (of chat/meeting) and files uploaded (to chat/meeting).
- Prasad_Das-MSFT
Microsoft
chrisfellows - Currently there is no API available to achieve this functionality. There is only the ability to get and list recordings of meetings: callRecording resource type - Microsoft Graph beta | Microsoft Learn.
To achieve your requirements, we recommend you give your feedback in Teams Feedback Portal.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- Sayali-MSFT
Microsoft
chrisfellows- Thanks for reporting your issue.
We will check this at our end and will get back to you.