block a message in Microsoft Teams

Copper Contributor

Now we plan to develop a data protection App for Microsoft Teams. One feature is block a message when the message includes someone keyword.

Now we can use delegated permission and Teams itself http API(******/messages/******?behavior=softDelete) to delete the message, but it not friendly to Teams Users, We try found a better method to implement it.


We found nothing but some similar production like Mcafee and Smarsh released on MS Office website they have implemented block-message function, like below picture:



We asked the same question on SOF: Could someone tell us how to implement the function, Thanks very much.


Another, we do remove a chat participant by the same way. Is there any track to remove a chat participant directly

7 Replies
Just a FYI, you know this feature does exist with DLP for teams?

Cheers / adam

@adam deltingerThanks for your relay.


I had used MS DLP on trial, but I could not find relative APIs for calling, because we plan to implement the function without DLP, like office 365 E3 and so on.


it is said that


Protect information with the Microsoft native data loss prevention (DLP) solution for Teams, options from Smarsh and McAfee, and solutions you can build and integrate using our open APIs (offered soon).



By research, some products have integrate the function, is there someone way to get the APIs.

I'm a newbie programmer, could you give me some advises, thank you very much.

I don't have an answer but I'd love to know how these 3rd parties can modify an existing message, I need to something similar for a different reason.

@Hilton GiesenowGraph Delegate permission + API(******/messages/******?behavior=softDelete)

@NextLabs_Tiger sure but that's to delete - I want to know how to -modify- a message after it's typed, before it gets posted, like for instance to redact a word. 

@Hilton Giesenow I has consult a Teams PM, the office interface is disable in his document.

you can try and test below api that I never test, maybe it can work.





Thanks to share your findings. In order to call above API, how did you impersonate the user? I could see, we have to pass a skypeToken which associate with user, but how can we get it.