Share via

how to know if user has blocked bot conversation teams

Vivek Nuna 30 Reputation points
2026-04-13T13:00:15.2366667+00:00

We have developed ms teams app. I would like to receive a message or event if a user blocks the my teams app. I could not find any such event

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

2 answers

Sort by: Most helpful
  1. Sayali-MSFT 5,686 Reputation points Microsoft External Staff Moderator
    2026-04-14T08:10:15.16+00:00

    Hello @Vivek Nuna,
    Microsoft Teams does not provide any event or lifecycle notification when a user blocks or uninstalls your app from personal scope, as this is treated as a user‑privacy action and not an app lifecycle change. As a result, no conversationUpdate, installationUpdate, Graph webhook, or Bot Framework event is triggered when this occurs. The only supported way to detect that a user has blocked your app is indirectly—when sending a proactive message, the request will fail with a 403 Forbidden error such as MessageWritesBlocked or BotDisabledByUser, which you can catch in your code and use to mark the user as inactive or blocked.

    Was this answer helpful?

    0 comments No comments

  2. Michelle-N 16,035 Reputation points Microsoft External Staff Moderator
    2026-04-13T13:38:17.94+00:00

    Hi @Vivek Nuna

    From the information you provided, I understand that you have developed a Microsoft Teams app and are looking for a way to receive an event or message notification whenever a user blocks your app.

    After researching this, it appears that, at this time, there is no specific event or notification in Microsoft Teams that alerts you when a user blocks your bot. According to official Microsoft documentation, the Bot Framework and Microsoft Graph only provide events such as conversationUpdate (for adding or removing members, installing, or uninstalling the app), as well as message and reaction events. There is no event triggered to indicate that a user has blocked or muted a bot.

    However, as a workaround, you can still create a report to understand which users in your organization have blocked, muted, or uninstalled the bot. This information can be incredibly helpful for your organization's admins when broadcasting org-wide messages or driving app usage.

    When you attempt to send a proactive message to the bot, if the user has blocked or uninstalled it, Teams will return an HTTP 403 Forbidden response code with the subCode MessageWritesBlocked. This response effectively indicates that the message sent by the bot was not delivered to the user.

    Here is an example of what that 403 response code looks like:

    HTTP/1.1 403 Forbidden
    Cache-Control: no-store, must-revalidate, no-cache
     Pragma: no-cache
     Content-Length: 196
     Content-Type: application/json; charset=utf-8
     Server: Microsoft-HTTPAPI/2.0
     Strict-Transport-Security: max-age=31536000; includeSubDomains
     MS-CV: NXZpLk030UGsuHjPdwyhLw.5.0
     ContextId: tcid=0,server=msgapi-canary-eus2-0,cv=NXZpLk030UGsuHjPdwyhLw.5.0
     Date: Tue, 29 Mar 2022 17:34:33 GMT
    {"errorCode":209,"message":"{\r\n  \"subCode\": \"MessageWritesBlocked\",\r\n  \"details\": \"Thread is blocked from message writes.\",\r\n  \"errorCode\": null,\r\n  \"errorSubCode\": null\r\n}"}
    

    What the official documentation recommends you do when you receive this error:

    1. Delete the conversation reference from your cache/database for that user.
    2. Stop attempting to send messages to that conversation.
    3. Resume only when the user explicitly initiates interaction again (e.g., they send a message to the bot or re-open the chat). This action automatically unblocks it from the bot's perspective.

    You can (and should) log this error in your bot's message-sending logic so you can track which users have blocked the app.

    Reference: https://github.com/MicrosoftDocs/msteams-docs/blob/main/msteams-platform/bots/how-to/conversations/send-proactive-messages.md

    I hope this information helps clarify the situation


    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.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.