How to Create and Use Microsoft Teams Webhooks

Using webhooks in Teams improves collaboration with your team

Reading time icon 4 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

How to use incoming and outgoing webhooks in Microsoft Teams

Setting up webhooks in Microsoft Teams can significantly enhance your team’s communication and integration with other tools. Whether you need to send notifications to external services or receive updates from other applications, this guide will walk you through the process of creating both outgoing and incoming webhooks in just a few minutes.

How do I create webhooks in Microsoft Teams?

1. Create an Outgoing Webhook in Microsoft Teams

  1. Open Microsoft Teams and go to the team where you want to add the outgoing webhook.
  2. Click on the team name and then click on More options (three dots) > Manage team.
  3. Select the Apps tab.
  4. Click on Create an outgoing webhook in the bottom right corner.
  5. Provide a name for your webhook.
  6. Enter an address, description, and optionally, upload a profile picture and click Create.
  7. Copy the security token that appears. Important: You will only see this token once, so make sure to store it safely.

By creating an outgoing webhook, you enable your team to send messages to external services, which is useful for sending notifications or data to other apps.

2. Add an Incoming Webhook in Microsoft Teams

  1. Open Microsoft Teams and go to the team and channel where you want to add an incoming webhook.
  2. Click on the channel name and then click on More options (three dots) > Connectors.
  3. Search for Incoming Webhook and select Add.
  4. Click Configure.
  5. Provide a name for the webhook and optionally upload an image, then click Create.
  6. Copy the unique URL provided and save it. You will need this URL to send information to the Teams channel.
  7. Click Done.

Using an incoming webhook allows external applications to send messages into Microsoft Teams, which can be helpful for integrating notifications or updates from other tools directly into your channels.

3. Use Visual Studio to set up Outgoing Webhooks

  1. Ensure you have Visual Studio 2022 installed, with the ASP.NET and web development workloads.
  2. Open Visual Studio and create a new ASP.NET Core Web App.
  3. Set up a tunnel using dev tunnel:
    • Select Dev Tunnels from the debug dropdown list and click Create a Tunnel.
    • Fill in the details (Account, Name, Tunnel Type, Access) and click OK.
  4. Select F5 to run the application in debug mode, opening the dev tunnel.
  5. In Teams, go to the team where you want to add the webhook.
  6. Click More options > Manage team > Apps > Create an outgoing webhook.
  7. Fill in the details using the URL generated from dev tunnel.

Setting up outgoing webhooks through Visual Studio with a tunnel can be a more advanced and flexible way to integrate Teams with other apps, especially for development and testing purposes.

4. Configure Incoming Webhooks for PostHog

  1. In Microsoft Teams:
    • Navigate to the channel where you want to add the webhook.
    • Click on More options > Connectors > Incoming Webhook.
    • Click Configure, provide a name, upload an image (optional), and click Create.
    • Copy the unique URL provided.
  2. In PostHog:
    • Go to Project settings.
    • Paste the copied URL into the Webhook integration section.
    • Click Test & Save to ensure the integration works.
  3. To post actions to the webhook in PostHog:
    • Navigate to the action you want to trigger the webhook.
    • Select Post to webhook when this action is triggered.

This method ensures that you can easily track and notify your team in Microsoft Teams whenever specific actions occur in PostHog.

By following these solutions, you can effectively create and manage webhooks in Microsoft Teams to improve your team’s communication and integration with other tools.

If you’re interested in other collaboration features, here’s our guide on how to integrate Microsoft Teams and Slack. We also have a guide on enabling API Key Availability in Teams.

What do you think about using webhooks in Microsoft Teams? Tell us all about it in the comments below.

More about the topics: Microsoft Teams