# Create a Microsoft Teams Webhook URL

*Applies to: Patch My PC Publisher*

## Create a Workflow

Microsoft Teams webhooks used by the Publisher are created using Teams Workflows. This workflow generates a webhook URL that can be used to send notifications to a specific Teams channel.

To create a webhook URL:

1. Open Microsoft Teams and navigate to the Channel where you want to receive Webhook Notifications.
2. Click the More Options button **…** and select **Workflows**.&#x20;

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FKYDn09OiYnHKqhyTXJOX%2Fimage.png?alt=media&#x26;token=93176f14-3dad-47af-9513-bbed0a4b399c" alt="Teams Workflows" width="524"><figcaption></figcaption></figure>

3. Select **Send webhook alerts to a channel**.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FWomH5IunUVTJzl4569WI%2Fimage.png?alt=media&#x26;token=11f2bec2-06a0-4d0e-92d1-69da10b3cf2f" alt="Send webhook alerts to a channel" width="429"><figcaption></figcaption></figure>

4. Allow a moment for the template to load, it can take a minute. Optionally, update the **Name** of the workflow so it can be easily distingushed in PowerAutomate. Click **Next.**

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FcvUiAqKhfNwXk0nQNRCS%2Fimage.png?alt=media&#x26;token=b756a44e-ab1b-455f-ba06-3a5d0b3d2ab9" alt="Name the workflow" width="563"><figcaption></figcaption></figure>

5. Allow a moment for the details tab to load to verify which Team and Channel the webhook URL will be created for and click **Add workflow**.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2F63DKoEVX14FySYajquZs%2Fimage.png?alt=media&#x26;token=b9454245-9457-4022-bc37-61bde1fab04c" alt="Add the workflow" width="563"><figcaption></figcaption></figure>

6. Click the **copy** icon to copy the webhook URL to your clipboard before click **Done**.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FXIiKK1qDS1WFhGMoY0cN%2Fimage.png?alt=media&#x26;token=1f715a90-8730-4bce-8845-4fbf4dc9cc11" alt="Copy the webhook URL" width="563"><figcaption></figcaption></figure>

The copied URL can be used when [adding ](https://docs.patchmypc.com/patch-my-pc-publisher/administration/alerts/webhook-notification-settings#add-a-webhook)or [editing ](https://docs.patchmypc.com/patch-my-pc-publisher/administration/alerts/webhook-notification-settings#edit-a-webhook)a webhook in the Publisher.

## Consideration for Teams Private Channels

Microsoft Teams private channels have stricter permission boundaries than standard channels. Workflows created using Power Automate run as bots by default, and bots are not permitted to post messages to private channels unless explicitly configured.&#x20;

To allow webhook notifications to be delivered to a private channel, the workflow must be updated to post messages as a user instead of as a bot.

Update the Workflow **Post As** Setting:

1. Navigate to [https://make.powerautomate.com](https://make.powerautomate.com/)
2. Locate the workflow used for Teams notifications targeting the private channel and select **Edit**.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2Ft0Wm0OyLgRxciqt0IuBw%2Fimage.png?alt=media&#x26;token=08b0cb7c-50f0-44e3-9f9a-c436ab7fedd2" alt="Edit the Workflow" width="563"><figcaption></figcaption></figure>

3. Select the workflow step named **Post card in a chat or channel**
4. Change the **Post As** value from **Bot** to **User**.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FnHRLu8MIth2xfFHqfGuo%2Fimage.png?alt=media&#x26;token=dda0a065-558c-427f-bc9b-1acd8eff0d32" alt="Post as User not Bot" width="563"><figcaption></figcaption></figure>

5\. Save the workflow.

After this change, webhook notifications can be successfully delivered to Microsoft Teams private channels.
