> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Teams Webhook Setup Guide

> Configure Microsoft Teams to deliver events to StackOne.

## Prerequisites

The connector should already be set up, with a Connector Profile and a Linked Account. See [Getting Started](/connectors/microsoftteams#getting-started) on the Microsoft Teams connector page.

<section data-guide-section data-guide-scopes="">
  <h2>Prerequisites</h2>

  <p>StackOne automatically creates and manages Microsoft Graph subscriptions on your behalf. To receive webhook events, your Azure app registration must have the correct API permissions granted.</p>

  <Steps>
    <Step title="Verify API Permissions">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to the <a href="https://entra.microsoft.com" target="_blank" rel="noopener noreferrer">Microsoft Entra admin center</a> and navigate to your app registration. Under <strong>API permissions</strong>, confirm the following <strong>Application permissions</strong> are granted and admin-consented.</p>

        <ul>
          <li><strong>ChannelMessage.Read.All</strong> — Required for channel message events (created, updated, deleted).</li>
          <li><strong>Chat.Read.All</strong> — Required for chat message events (created, updated, deleted) and chat member events.</li>
          <li><strong>Team.ReadBasic.All</strong> — Required for team events (created, updated, deleted).</li>
          <li><strong>Channel.ReadBasic.All</strong> — Required for channel events (created, updated, deleted).</li>
          <li><strong>ChatMember.Read.All</strong> — Required for chat member events (added, updated, removed).</li>
        </ul>
      </div>
    </Step>

    <Step title="Grant Admin Consent">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>After adding the permissions, click <strong>Grant admin consent for \[tenant name]</strong> and select <strong>Yes</strong>. Verify that <strong>Granted for \[tenant name]</strong> appears under the <strong>Status</strong> column for each permission.</p>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Available Webhook Events</h2>

  <p>When you enable webhook events for Microsoft Teams, StackOne subscribes to Microsoft Graph change notifications. Only events you select in StackOne are delivered to your application.</p>

  <Steps>
    <Step title="Channel Message Events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events fired when messages are posted, edited, or deleted in Teams channels.</p>

        <ul>
          <li><strong>Channel Message Created</strong> (`/teams/getAllMessages_created`) — Fired when a new message is posted in a Teams channel.</li>
          <li><strong>Channel Message Updated</strong> (`/teams/getAllMessages_updated`) — Fired when a message is edited in a Teams channel.</li>
          <li><strong>Channel Message Deleted</strong> (`/teams/getAllMessages_deleted`) — Fired when a message is deleted from a Teams channel.</li>
        </ul>
      </div>
    </Step>

    <Step title="Chat Message Events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events fired when messages are sent, edited, or deleted in 1:1 or group chats.</p>

        <ul>
          <li><strong>Chat Message Created</strong> (`/chats/getAllMessages_created`) — Fired when a new 1:1 or group chat message is sent.</li>
          <li><strong>Chat Message Updated</strong> (`/chats/getAllMessages_updated`) — Fired when a 1:1 or group chat message is edited.</li>
          <li><strong>Chat Message Deleted</strong> (`/chats/getAllMessages_deleted`) — Fired when a 1:1 or group chat message is deleted.</li>
        </ul>
      </div>
    </Step>

    <Step title="Team Events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events fired when teams are created, modified, or deleted.</p>

        <ul>
          <li><strong>Team Created</strong> (`/teams_created`) — Fired when a new team is created.</li>
          <li><strong>Team Updated</strong> (`/teams_updated`) — Fired when a team's properties are updated.</li>
          <li><strong>Team Deleted</strong> (`/teams_deleted`) — Fired when a team is deleted.</li>
        </ul>
      </div>
    </Step>

    <Step title="Channel Events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events fired when channels are created, modified, or deleted in any team.</p>

        <ul>
          <li><strong>Channel Created</strong> (`/teams/getAllChannels_created`) — Fired when a new channel is created in any team.</li>
          <li><strong>Channel Updated</strong> (`/teams/getAllChannels_updated`) — Fired when a channel's properties are updated.</li>
          <li><strong>Channel Deleted</strong> (`/teams/getAllChannels_deleted`) — Fired when a channel is deleted.</li>
        </ul>
      </div>
    </Step>

    <Step title="Chat Member Events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events fired when members are added to or removed from 1:1 or group chats.</p>

        <ul>
          <li><strong>Chat Member Added</strong> (`/chats/getAllMembers_created`) — Fired when a member is added to any 1:1 or group chat.</li>
          <li><strong>Chat Member Removed</strong> (`/chats/getAllMembers_deleted`) — Fired when a member is removed from any 1:1 or group chat.</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Delivery Format</h2>

  <p>Microsoft Graph sends change notifications as JSON payloads containing an array of notification objects.</p>

  <Steps>
    <Step title="Notification Payload Structure">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Each notification is delivered as a POST request with a JSON body containing a `value` array. Each element includes the `resource` path, `changeType` (created, updated, or deleted), `resourceData` with the resource ID, and `subscriptionExpirationDateTime`. By default, notifications do not include the full resource data — only metadata about the change. StackOne maps each notification to the corresponding event type based on the resource path and change type.</p>
      </div>
    </Step>

    <Step title="Subscription Lifecycle">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>StackOne automatically manages subscription creation, validation, and renewal. Microsoft Graph subscriptions for Teams resources expire after 3 days (4,230 minutes).</p>
      </div>
    </Step>
  </Steps>
</section>

## Verify

Your Connector should now be able to receive and process events. Try triggering an event and you should see an Event appear in the Connector logs.
