How to programmatically delete chat recordings and uploaded files

Copper Contributor

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?

 

 

 

 

4 Replies
@chrisfellows- Thanks for reporting your issue.
We will check this at our end and will get back to you.

@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
I don't need to delete messages or chats. I need to delete recordings (of chat/meeting) and files uploaded (to chat/meeting).
@chrisfellows -We are checking it internally and get back to you once we get any update.