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

# Integrate with Teams

> Send customized Teams messages directly from a Next Matter workflow to dedicated channels.

## Before you begin

Prepare to connect to Microsoft

As part of the integration, you need to allowlist the Next Matter domain and create a service account. [See if you've completed all the required steps](/docs/integrate-with-microsoft).

## Next Matter and Teams

Integrating Next Matter and Teams allows you to send messages to a dedicated Teams channel directly from a Next Matter workflow. This helps team members stay informed about important events or updates. For example, you can send a structured message into a Microsoft Teams channel, notifying users of a newly submitted workflow instance. The message contains a link allowing users to view the specific workflow instance.

To complete the integration you'll need the following:

1. Whitelist the nextmatter.com domain in MS Teams
2. Create Next Matter as a webhook in Teams (... > Connectors > Incoming webhook)
3. Create a Next Matter Bot in Teams
4. Update the workflow to send a message to a Teams channel.

### Create a Next Matter Bot in your Teams workspace

1. In your Teams, click **...** next to the channel name.
2. Click **Connectors**.
3. Scroll through the list of connectors to **Incoming Webhook**, and click **Configure**.
4. Create Next Matter as a webhook. You can also upload a logo.
5. Click **Create**.
6. Copy the URL.
7. Click **Done**.

### Configure the notification step in your workflow

1. In your Next Matter portal, click **Workflows**, and then click the workflow you want to update.

2. Click **Edit workflow**.

3. Click **+Add step** and select **Integration > Custom integration**.

4. Click **Settings** to configure the step.

5. Enter the following details:

   * **Method**: POST
   * **URL**: `WEBHOOK_URL_FROM_TEAMS`
   * **Headers**: Content-Type: application/json
   * In the **Body** enter the values. For example, the body might look like the following.

   <CodeGroup>
     ```json JSON theme={null}
     {
        "type":"message",
        "attachments":[
           {
              "contentType":"application/vnd.microsoft.card.adaptive",
              "contentUrl":null,
              "content":{
                 "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
                 "type":"AdaptiveCard",
                 "version":"1.2",
                 "body":[
             {
                 "type": "TextBlock",
                 "id": "383d1a2b-cf19-4fce-7544-e8fdd00b4ad7",
                 "text": "A new workflow instance with the name {Instance name}
      has been submitted by {Instance lead user name}.Text: MESSAGE_TO_SEND",             
                 "wrap": true,
                 "weight": "Bolder"
             },
             {
                 "type": "ActionSet",
                 "id": "fd477c49-9c5a-58d6-0aa8-435c979f096b",
                 "actions": [
                     {
                         "type": "Action.OpenUrl",
                         "id": "e0051bb0-8f27-0309-eeac-8f3bac32d7d3",
                         "title": "View workflow Instance",
                         "url": "{Instance URL}",                     
                         "style": "positive",
                         "isPrimary": true
                     }
                 ],
                 "horizontalAlignment": "Center"
             }
            
         ]
              }
           }
        ]
     }
     ```
   </CodeGroup>

6. Save your changes.
