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

# Mattermost incoming webhooks

<View title="Developer" />

<View title="Federal docs" />

<View title="EU docs" />

This topic explains how to use the LaunchDarkly Mattermost incoming webhooks integration.

The Mattermost incoming webhooks integration sends you alerts when the LaunchDarkly resources you care about, such as feature flags, projects, and account members, change. These notifications appear in your Mattermost channel.

## Prerequisites

To use this integration, you must have:

* A Mattermost workspace with permission to create incoming webhooks
* A LaunchDarkly account with permission to create integrations

## Set up an incoming webhook in Mattermost

To add LaunchDarkly to a Mattermost workspace, you first configure an incoming webhook in Mattermost, then add the webhook URL to LaunchDarkly.

Follow these steps:

1. Sign in to your Mattermost workspace.
2. From the main menu, navigate to **Integrations** > **Incoming Webhooks**.
3. Click **Add Incoming Webhook**.
4. Fill in the display name (for example, "LaunchDarkly"), an optional description, and select the channel you want notifications delivered to.
5. Click **Save**.
6. Copy the provided webhook URL to your clipboard. You will need it in the next procedure.

To learn more about creating incoming webhooks in Mattermost, read [Mattermost's incoming webhooks documentation](https://developers.mattermost.com/integrate/webhooks/incoming/).

## Connect LaunchDarkly to Mattermost

To configure LaunchDarkly to connect with the Mattermost webhook:

1. In LaunchDarkly, click the **gear** icon in the left sidebar to view Organization settings.
2. Click **Integrations** and find "Mattermost incoming webhooks."
3. Click **Add integration**. The "Create Mattermost incoming webhooks configuration" panel appears.
4. Paste your **Incoming webhook URL** into the field.
5. Set any filters for sending notifications to Mattermost by configuring a policy. LaunchDarkly sends all flag change events in the production environment to Mattermost by default. To learn more about creating a policy filter, read [Add a policy filter](#add-a-policy-filter).
6. Click **Save configuration**.

You are now notified in your Mattermost channel when someone updates a flag.

### Add a policy filter

LaunchDarkly sends all flag change events in the production environment to a webhook by default. To customize the events LaunchDarkly sends to your Mattermost channel, use the policy editor in the webhook creation panel.

For example, if you want to receive an event only when a change is made to one of your production feature flags, you can add the following policy to the webhook integration:

<CodeGroup>
  ```json title="Policy" lines wrap theme={null}
  [
    {
      "effect": "allow",
      "actions": ["*"],
      "resources": ["proj/*:env/production:flag/*"]
    }
  ]
  ```
</CodeGroup>

To learn more, read [Example roles and policies](/docs/home/account/roles/example-roles).

## Disable a Mattermost incoming webhook

To temporarily disable a Mattermost incoming webhook:

1. In LaunchDarkly, navigate to the **Integrations** page and find "Mattermost incoming webhooks."
2. Click the **expand arrow** to display all of the configured webhooks.
3. Click the **pencil** icon next to the webhook you want to disable. The "Edit Mattermost incoming webhooks configuration" panel appears.
4. Toggle the switch **Off**.
