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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> To translate a template, write one locale at a time with `PUT /notifications/{id}/locales/{localeId}`, which merges into the existing translations. `PUT /notifications/{id}/content` and `PUT /notifications/{id}/elements/{elementId}` overwrite translations along with the content, so send each element's `id` and `locales` back, and first remove every `checksum` and any `locales` key that starts with an underscore.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Adding notifications to a framework app? Start from its quickstart, which has a runnable repo and complete files: Next.js email https://www.courier.com/docs/guides/add-transactional-email-to-nextjs.md, Django https://www.courier.com/docs/guides/add-notifications-to-django.md, Rails https://www.courier.com/docs/guides/add-notifications-to-rails.md, Node.js digest https://www.courier.com/docs/guides/batch-notifications-into-a-daily-digest-in-node.md, Laravel https://www.courier.com/docs/guides/add-notifications-to-laravel.md, FastAPI https://www.courier.com/docs/guides/send-notifications-from-fastapi.md, Express https://www.courier.com/docs/guides/add-notifications-to-express.md, and the React, Next.js, Astro, and Nuxt inbox quickstarts under /guides/add-an-inbox-to-*.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Move off Microsoft Teams Incoming Webhooks after the connector retirement

> Teams Incoming Webhooks stopped working in May 2026. Compare Workflows webhooks with a bot, then post to your team's or customers' channels with Courier.

Microsoft retired Office 365 Connectors in Teams, including Incoming Webhooks, in May 2026, so old webhook URLs no longer post. Courier sends through a Teams bot instead, which the retirement didn't touch.

This guide picks a replacement, then moves each webhook to a channel send through your bot, in your own organization or a customer's.

## What changed

Microsoft finished turning off Office 365 Connectors between May 18 and May 22, 2026, after moving the date several times since 2024. Every connector URL created in Teams, including Incoming Webhook URLs, stopped delivering. [Microsoft's retirement notice](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) has the full history.

Microsoft offers two replacements, and they solve different problems:

| | Workflows webhook | Bot, sent through Courier |
| :- | :- | :- |
| Built with | Power Automate's "When a Teams webhook request is received" trigger | An Azure app registration and a Teams app you install |
| Reaches | One channel or chat per workflow | Any channel, group chat, or user where the app is installed |
| Owned by | Whoever built the workflow, plus any co-owners | Your app, through its credentials |
| Posts as | The Workflows bot, with no custom name or icon | Your bot, with your app's name and icon |
| Limits | 4 requests a second, 28 KB a message | Bot Framework limits |
| Fits | Alerts into your own team's channel | Product notifications to customers, many teams, or individual users |

Use a Workflows webhook for one internal alerts channel. [Microsoft's guide](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) covers it, and it needs no code beyond the POST. Use a bot when the message comes from your product, because a workflow belongs to whoever built it and posts to one channel. That is the path below.

## Prerequisites

* [A Courier Test API key](https://app.courier.com/~/test/platform/api-keys)
* A Teams bot connected to Courier and installed in the team. [Send your first Microsoft Teams message](https://www.courier.com/docs/guides/send-your-first-teams-message.md) covers both, in steps 1 and 2
* A published [template](https://www.courier.com/docs/design/templates/overview.md) with a Microsoft Teams channel

## Move a webhook to a bot

**1. Find your bot's home tenant**

Open the bot's app registration in the [Azure portal](https://portal.azure.com/) and copy the **Directory (tenant) ID** from its **Overview** page. That is the bot's home tenant, which you send as `source_tenant_id`.

**2. Copy the channel's ids**

In Teams, open the channel's **...** menu and choose **Copy link**. The link carries both ids you need:

```text Channel link theme={null}
https://teams.microsoft.com/l/channel/19%3A5140d7460868414cac958ac76a0a94d0%40thread.skype/alerts?groupId=feb55fc1-9e00-40f3-93b8-f7d14703f4dd&tenantId=dabd1935-56a4-4305-938e-0840e2e84515
```

URL-decode the path segment after `/channel/` for the channel id, `19:5140d7460868414cac958ac76a0a94d0@thread.skype`. Newer channels end in `@thread.tacv2` instead. The `tenantId` query parameter is the organization, `dabd1935-56a4-4305-938e-0840e2e84515`.

Sending by `channel_id` needs no Microsoft Graph permissions. Someone still installs your app in the team, so the organization's Teams settings must allow custom apps.

**3. Send to the channel**

Put the ids in `to.ms_teams` and send a template with a Teams channel. `source_tenant_id` is your bot's home tenant from step 1. Courier needs it when the channel belongs to another organization, such as a customer's. It's safe on every send, because for your own organization it equals `tenant_id`. [Bots in a different tenant](https://www.courier.com/docs/integrations/direct-message/microsoft-teams.md#bots-in-a-different-tenant) explains the split.

```javascript Node.js highlight={4-9} theme={null}
const { requestId } = await courier.send.message({
  message: {
    to: {
      ms_teams: {
        channel_id: "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
        tenant_id: "dabd1935-56a4-4305-938e-0840e2e84515",
        source_tenant_id: "<bot_home_tenant_id>",
        service_url: "https://smba.trafficmanager.net/amer",
      },
    },
    template: "nt_01kx4h2jdafq8bk9aftxak4b40",
  },
});
```

```python Python highlight={4-9} theme={null}
response = client.send.message(
    message={
        "to": {
            "ms_teams": {
                "channel_id": "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
                "tenant_id": "dabd1935-56a4-4305-938e-0840e2e84515",
                "source_tenant_id": "<bot_home_tenant_id>",
                "service_url": "https://smba.trafficmanager.net/amer",
            },
        },
        "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
    },
)
```

```bash cURL highlight={7-12} wrap theme={null}
curl -X POST https://api.courier.com/send \
  -H "Authorization: Bearer $COURIER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": {
      "to": {
        "ms_teams": {
          "channel_id": "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
          "tenant_id": "dabd1935-56a4-4305-938e-0840e2e84515",
          "source_tenant_id": "<bot_home_tenant_id>",
          "service_url": "https://smba.trafficmanager.net/amer"
        }
      },
      "template": "nt_01kx4h2jdafq8bk9aftxak4b40"
    }
  }'
```

```ruby Ruby highlight={4-9} theme={null}
response = courier.send_.message(
  message: {
    to: {
      ms_teams: {
        channel_id: "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
        tenant_id: "dabd1935-56a4-4305-938e-0840e2e84515",
        source_tenant_id: "<bot_home_tenant_id>",
        service_url: "https://smba.trafficmanager.net/amer"
      }
    },
    template: "nt_01kx4h2jdafq8bk9aftxak4b40"
  }
)
```

```go Go highlight={4-9} theme={null}
// This provider addresses the recipient with fields outside the typed
// UserRecipient model, so pass the recipient as raw JSON.
to := param.Override[shared.UserRecipientParam](json.RawMessage(`{
  "ms_teams": {
    "channel_id": "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
    "tenant_id": "dabd1935-56a4-4305-938e-0840e2e84515",
    "source_tenant_id": "<bot_home_tenant_id>",
    "service_url": "https://smba.trafficmanager.net/amer"
  }
}`))

response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
	Message: courier.SendMessageParamsMessage{
		To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
	},
})
```

```java Java highlight={6-11} theme={null}
SendMessageParams params = SendMessageParams.builder()
    .message(SendMessageParams.Message.builder()
        // This provider addresses the recipient with fields outside the
        // typed UserRecipient model, so pass them as additional properties.
        .to(UserRecipient.builder()
            .putAdditionalProperty("ms_teams", JsonValue.from(java.util.Map.of(
                "channel_id", "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
                "tenant_id", "dabd1935-56a4-4305-938e-0840e2e84515",
                "source_tenant_id", "<bot_home_tenant_id>",
                "service_url", "https://smba.trafficmanager.net/amer"
            )))
            .build())
        .template("nt_01kx4h2jdafq8bk9aftxak4b40")
        .build())
    .build();
SendMessageResponse response = client.send().message(params);
```

```php PHP highlight={4-9} theme={null}
$response = $client->send->message(
  message: [
    'to' => [
      'ms_teams' => [
        'channel_id' => '19:5140d7460868414cac958ac76a0a94d0@thread.skype',
        'tenant_id' => 'dabd1935-56a4-4305-938e-0840e2e84515',
        'source_tenant_id' => '<bot_home_tenant_id>',
        'service_url' => 'https://smba.trafficmanager.net/amer',
      ],
    ],
    'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
  ],
);
```

```csharp C# highlight={11-16} theme={null}
SendMessageParams parameters = new()
{
    Message = new()
    {
        // This provider addresses the recipient with fields outside the
        // typed UserRecipient model, so build it from raw JSON.
        To = UserRecipient.FromRawUnchecked(
            JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                """
                {
                  "ms_teams": {
                    "channel_id": "19:5140d7460868414cac958ac76a0a94d0@thread.skype",
                    "tenant_id": "dabd1935-56a4-4305-938e-0840e2e84515",
                    "source_tenant_id": "<bot_home_tenant_id>",
                    "service_url": "https://smba.trafficmanager.net/amer"
                  }
                }
                """
            )
        ),
        Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
    },
};

var response = await client.Send.Message(parameters);
```

```bash CLI highlight={3} wrap theme={null}
courier send message \
  --api-key "$COURIER_API_KEY" \
  --message.to '{"ms_teams": {"channel_id": "19:5140d7460868414cac958ac76a0a94d0@thread.skype", "tenant_id": "dabd1935-56a4-4305-938e-0840e2e84515", "source_tenant_id": "<bot_home_tenant_id>", "service_url": "https://smba.trafficmanager.net/amer"}}' \
  --message.template nt_01kx4h2jdafq8bk9aftxak4b40
```

```text MCP theme={null}
With Courier MCP, send my template to the alerts channel in Microsoft Teams.
```

`service_url` defaults to `https://smba.trafficmanager.net/amer`, the Americas endpoint. Microsoft lists `https://smba.trafficmanager.net/teams` as its global endpoint, without a trailing slash, because Courier adds the path. [Profile requirements](https://www.courier.com/docs/integrations/direct-message/microsoft-teams.md#profile-requirements) lists every other way to address a recipient, including users by `email` and thread replies.

## Verify

**1. Check the channel**

The message appears in the channel from your bot, with your app's name and icon.

**2. Read the status**

Open [Logs](https://app.courier.com/logs) and find the send. A credential or install problem shows as `All Bot Framework authentication methods failed`, followed by the HTTP status.

That error on a channel post usually means the app isn't installed in that team, or the credentials in Courier aren't the bot's. [Troubleshooting](https://www.courier.com/docs/integrations/direct-message/microsoft-teams.md#troubleshooting) covers the other causes.

## Move an existing connector integration

If your code posted to Incoming Webhook URLs, three things change:

* **A URL per channel becomes two ids per channel.** Store `channel_id` and `tenant_id` where you stored the webhook URL, and install your app in each team that had one.
* **MessageCard becomes an Adaptive Card.** Build the card in the template with a Jsonnet block, as [Adaptive Cards](https://www.courier.com/docs/integrations/direct-message/microsoft-teams.md#adaptive-cards) shows, and keep the send unchanged.
* **The code stops building payloads.** The send names a template and a recipient, so card layout lives in the template instead of in your service.

## What changes in production

**Store each customer's ids once.** Each organization that installs your app has its own `tenant_id` and channel ids. Keep them with the customer record, or on a [tenant's `user_profile`](https://www.courier.com/docs/tenants/context#what-inherits-and-what-doesnt) if you already model customers as tenants. Don't post to a channel by sending to `to.tenant_id`, because that sends once per member of the tenant.

**Ask customers for a channel link.** Their Teams admin uploads your app package to their organization's app catalog, or installs it from the Teams Store if you publish there. They add it to a team and paste the channel's link into your settings page. Your service decodes the two ids from it, as in step 3.

**Client secrets expire.** Azure asks for an expiry date when you create the secret. Rotate it in Courier's Teams integration before that date, or every send fails with `Failed to acquire any Bot Framework authentication token`.

## FAQ

> [accordion] Do Teams Incoming Webhooks still work?
>
> Teams Incoming Webhooks stopped posting when Microsoft retired Office 365 Connectors between May 18 and May 22, 2026. Replace them with a Workflows webhook for internal alerts or a bot for product notifications.

> [accordion] Was Courier's Microsoft Teams integration affected by the connector retirement?
>
> Courier's Teams integration wasn't affected, because it sends through your bot with the Bot Framework's proactive messaging API. It never used Office 365 Connectors.

> [accordion] Is a Workflows webhook enough to notify customers in their Teams?
>
> A Workflows webhook rarely fits customer notifications. A workflow posts to one channel, belongs to whoever built it, and posts as the Workflows bot. Each customer would have to build and maintain their own, while one bot reaches every organization that installs your app.

> [accordion] Can Courier send to users as well as channels in Microsoft Teams?
>
> Courier sends to Teams users as well as channels. Address a user by `user_id`, by `email`, or by an existing `conversation_id`. Sending by `email` needs Microsoft Graph permissions with admin consent in the recipient's organization, as the [integration page](https://www.courier.com/docs/integrations/direct-message/microsoft-teams.md#profile-requirements) explains.
