
OpenClaw Integration with Microsoft Teams

By Sarah Jenkins


By Sarah Jenkins
"Abandon all hope, ye who enter here."
Updated: 2026-01-21
Status: text + DM attachments are supported; channel/group file sending requires sharePointSiteId + Graph permissions (see Sending files in group chats). Polls are sent via Adaptive Cards. Message actions expose explicit upload-file for file-first sends.
Microsoft Teams ships as a plugin and is not bundled with the core install.
Breaking change (2026.1.15): Microsoft Teams moved out of core. If you use it, you must install the plugin.
Explainable: keeps core installs lighter and lets Microsoft Teams dependencies update independently.
Install via CLI (npm registry):
openclaw plugins install @openclaw/msteamsLocal checkout (when running from a git repo):
openclaw plugins install ./path/to/local/msteams-pluginIf you choose Teams during setup and a git checkout is detected, OpenClaw will offer the local install path automatically.
/api/messages (port 3978 by default) via a public URL or tunnel.Minimal config:
{
channels: {
msteams: {
enabled: true,
appId: "<APP_ID>",
appPassword: "<APP_PASSWORD>",
tenantId: "<TENANT_ID>",
webhook: { port: 3978, path: "/api/messages" },
},
},
}Note: group chats are blocked by default (channels.msteams.groupPolicy: "allowlist"). To allow group replies, set channels.msteams.groupAllowFrom (or use groupPolicy: "open" to allow any member, mention-gated).
By default, Microsoft Teams is allowed to write config updates triggered by /config set|unset (requires commands.config: true).
Disable with:
{
channels: { msteams: { configWrites: false } },
}DM access
channels.msteams.dmPolicy = "pairing". Unknown senders are ignored until approved.channels.msteams.allowFrom should use stable AAD object IDs.channels.msteams.dangerouslyAllowNameMatching: true.Group access
channels.msteams.groupPolicy = "allowlist" (blocked unless you add groupAllowFrom). Use channels.defaults.groupPolicy to override the default when unset.channels.msteams.groupAllowFrom controls which senders can trigger in group chats/channels (falls back to channels.msteams.allowFrom).groupPolicy: "open" to allow any member (still mention‑gated by default).channels.msteams.groupPolicy: "disabled".Example:
{
channels: {
msteams: {
groupPolicy: "allowlist",
groupAllowFrom: ["user@org.com"],
},
},
}Teams + channel allowlist
channels.msteams.teams.groupPolicy="allowlist" and a teams allowlist is present, only listed teams/channels are accepted (mention‑gated).Team/Channel entries and stores them for you.and logs the mapping; unresolved team/channel names are kept as typed but ignored for routing by default unless channels.msteams.dangerouslyAllowNameMatching: true is enabled.
Example:
{
channels: {
msteams: {
groupPolicy: "allowlist",
teams: {
"My Team": {
channels: {
General: { requireMention: true },
},
},
},
},
},
}msteams in ~/.openclaw/openclaw.json (or env vars) and start the gateway./api/messages by default.Before configuring OpenClaw, you need to create an Azure Bot resource.
| Field | Value |
|---|---|
| Bot handle | Your bot name, e.g., openclaw-msteams (must be unique) |
| Subscription | Select your Azure subscription |
| Resource group | Create new or use existing |
| Pricing tier | Free for dev/testing |
| Type of App | Single Tenant (recommended - see note below) |
| Creation type | Create new Microsoft App ID |
Deprecation notice: Creation of new multi-tenant bots was deprecated after 2025-07-31. Use Single Tenant for new bots.
appIdappPasswordtenantIdhttps://your-domain.com/api/messagesTeams can't reach localhost. Use a tunnel for local development:
Option A: ngrok
ngrok http 3978
# Copy the https URL, e.g., https://abc123.ngrok.io
# Set messaging endpoint to: https://abc123.ngrok.io/api/messagesOption B: Tailscale Funnel
tailscale funnel 3978
# Use your Tailscale funnel URL as the messaging endpointInstead of manually creating a manifest ZIP, you can use the Teams Developer Portal:
This is often easier than hand-editing JSON manifests.
Option A: Azure Web Chat (verify webhook first)
Option B: Teams (after app installation)
openclaw plugins install @openclaw/msteamsopenclaw plugins install ./path/to/local/msteams-pluginbot entry with botId = <App ID>.personal, team, groupChat.supportsFiles: true (required for personal scope file handling).outline.png (32x32) and color.png (192x192).manifest.json, outline.png, color.png. {
channels: {
msteams: {
enabled: true,
appId: "<APP_ID>",
appPassword: "<APP_PASSWORD>",
tenantId: "<TENANT_ID>",
webhook: { port: 3978, path: "/api/messages" },
},
},
}You can also use environment variables instead of config keys:
MSTEAMS_APP_IDMSTEAMS_APP_PASSWORDMSTEAMS_TENANT_IDhttps://<host>:3978/api/messages (or your chosen path/port).msteams config exists with credentials.channels.msteams.historyLimit controls how many recent channel/group messages are wrapped into the prompt.messages.groupChat.historyLimit. Set 0 to disable (default 50).channels.msteams.dmHistoryLimit (user turns). Per-user overrides: channels.msteams.dms["<user_id>"].historyLimit.These are the existing resourceSpecific permissions in our Teams app manifest. They only apply inside the team/chat where the app is installed.
For channels (team scope):
ChannelMessage.Read.Group (Application) - receive all channel messages without @mentionChannelMessage.Send.Group (Application)Member.Read.Group (Application)Owner.Read.Group (Application)ChannelSettings.Read.Group (Application)TeamMember.Read.Group (Application)TeamSettings.Read.Group (Application)For group chats:
ChatMessage.Read.Chat (Application) - receive all group chat messages without @mentionMinimal, valid example with the required fields. Replace IDs and URLs.
{
$schema: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.23/MicrosoftTeams.schema.json",
manifestVersion: "1.23",
version: "1.0.0",
id: "00000000-0000-0000-0000-000000000000",
name: { short: "OpenClaw" },
developer: {
name: "Your Org",
websiteUrl: "https://example.com",
privacyUrl: "https://example.com/privacy",
termsOfUseUrl: "https://example.com/terms",
},
description: { short: "OpenClaw in Teams", full: "OpenClaw in Teams" },
icons: { outline: "outline.png", color: "color.png" },
accentColor: "#5B6DEF",
bots: [
{
botId: "11111111-1111-1111-1111-111111111111",
scopes: ["personal", "team", "groupChat"],
isNotificationOnly: false,
supportsCalling: false,
supportsVideo: false,
supportsFiles: true,
},
],
webApplicationInfo: {
id: "11111111-1111-1111-1111-111111111111",
},
authorization: {
permissions: {
resourceSpecific: [
{ name: "ChannelMessage.Read.Group", type: "Application" },
{ name: "ChannelMessage.Send.Group", type: "Application" },
{ name: "Member.Read.Group", type: "Application" },
{ name: "Owner.Read.Group", type: "Application" },
{ name: "ChannelSettings.Read.Group", type: "Application" },
{ name: "TeamMember.Read.Group", type: "Application" },
{ name: "TeamSettings.Read.Group", type: "Application" },
{ name: "ChatMessage.Read.Chat", type: "Application" },
],
},
},
}bots[].botId must match the Azure Bot App ID.webApplicationInfo.id must match the Azure Bot App ID.bots[].scopes must include the surfaces you plan to use (personal, team, groupChat).bots[].supportsFiles: true is required for file handling in personal scope.authorization.permissions.resourceSpecific must include channel read/send if you want channel traffic.To update an already-installed Teams app (e.g., to add RSC permissions):
manifest.json with the new settingsIncrement the version field (e.g., 1.0.0 → 1.1.0)manifest.json, outline.png, color.png)Works:
Does NOT work:
Adds:
| Capability | RSC Permissions | Graph API |
|---|---|---|
| Real-time messages | Yes (via webhook) | No (polling only) |
| Historical messages | No | Yes (can query history) |
| Setup complexity | App manifest only | Requires admin consent + token flow |
| Works offline | No (must be running) | Yes (query anytime) |
Bottom line: RSC is for real-time listening; Graph API is for historical access. For catching up on missed messages while offline, you need Graph API with ChannelMessage.Read.All (requires admin consent).
If you need images/files in channels or want to fetch message history, you must enable Microsoft Graph permissions and grant admin consent.
ChannelMessage.Read.All (channel attachments + history)Chat.Read.All or ChatMessage.Read.All (group chats)Additional permission for user mentions: User @mentions work out of the box for users in the conversation. However, if you want to dynamically search and mention users who are not in the current conversation, add User.Read.All (Application) permission and grant admin consent.
Teams delivers messages via HTTP webhook. If processing takes too long (e.g., slow LLM responses), you may see:
OpenClaw handles this by returning quickly and sending replies proactively, but very slow responses may still cause issues.
Teams markdown is more limited than Slack or Discord:
code, linksKey settings (see /gateway/configuration for shared channel patterns):
channels.msteams.enabled: enable/disable the channel.channels.msteams.appId, channels.msteams.appPassword, channels.msteams.tenantId: bot credentials.channels.msteams.webhook.port (default 3978)channels.msteams.webhook.path (default /api/messages)channels.msteams.dmPolicy: pairing | allowlist | open | disabled (default: pairing)channels.msteams.allowFrom: DM allowlist (AAD object IDs recommended). The wizard resolves names to IDs during setup when Graph access is available.channels.msteams.dangerouslyAllowNameMatching: break-glass toggle to re-enable mutable UPN/display-name matching and direct team/channel name routing.channels.msteams.textChunkLimit: outbound text chunk size.channels.msteams.chunkMode: length (default) or newline to split on blank lines (paragraph boundaries) before length chunking.channels.msteams.mediaAllowHosts: allowlist for inbound attachment hosts (defaults to Microsoft/Teams domains).channels.msteams.mediaAuthAllowHosts: allowlist for attaching Authorization headers on media retries (defaults to Graph + Bot Framework hosts).channels.msteams.requireMention: require @mention in channels/groups (default true).channels.msteams.replyStyle: thread | top-level.channels.msteams.teams.<teamId>.replyStyle: per-team override.channels.msteams.teams.<teamId>.requireMention: per-team override.channels.msteams.teams.<teamId>.tools: default per-team tool policy overrides (allow/deny/alsoAllow) used when a channel override is missing.channels.msteams.teams.<teamId>.toolsBySender: default per-team per-sender tool policy overrides ("*" wildcard supported).channels.msteams.teams.<teamId>.channels.<conversationId>.replyStyle: per-channel override.channels.msteams.teams.<teamId>.channels.<conversationId>.requireMention: per-channel override.channels.msteams.teams.<teamId>.channels.<conversationId>.tools: per-channel tool policy overrides (allow/deny/alsoAllow).channels.msteams.teams.<teamId>.channels.<conversationId>.toolsBySender: per-channel per-sender tool policy overrides ("*" wildcard supported).toolsBySender keys should use explicit prefixes:id:, e164:, username:, name: (legacy unprefixed keys still map to id: only).
channels.msteams.sharePointSiteId: SharePoint site ID for file uploads in group chats/channels.agent:<agentId>:<mainKey>).agent:<agentId>:msteams:channel:<conversationId>agent:<agentId>:msteams:group:<conversationId>Teams recently introduced two channel UI styles over the same underlying data model:
| Style | Description | Recommended replyStyle |
|---|---|---|
| Posts (classic) | Messages appear as cards with threaded replies underneath | thread (default) |
| Threads (Slack-like) | Messages flow linearly, more like Slack | top-level |
The problem: The Teams API does not expose which UI style a channel uses. If you use the wrong replyStyle:
thread in a Threads-style channel → replies appear nested awkwardlytop-level in a Posts-style channel → replies appear as separate top-level posts instead of in-threadSolution: Configure replyStyle per-channel based on how the channel is set up:
{
channels: {
msteams: {
replyStyle: "thread",
teams: {
"19:abc...@thread.tacv2": {
channels: {
"19:xyz...@thread.tacv2": {
replyStyle: "top-level",
},
},
},
},
},
},
}Current limitations:
action=upload-file with media / filePath / path; optional message becomes the accompanying text/comment, and filename overrides the uploaded name.Without Graph permissions, channel messages with images will be received as text-only (the image content is not accessible to the bot). By default, OpenClaw only downloads media from Microsoft/Teams hostnames. Override with channels.msteams.mediaAllowHosts (use ["*"] to allow any host). Authorization headers are only attached for hosts in channels.msteams.mediaAuthAllowHosts (defaults to Graph + Bot Framework hosts). Keep this list strict (avoid multi-tenant suffixes).
Bots can send files in DMs using the FileConsentCard flow (built-in). However, sending files in group chats/channels requires additional setup:
| Context | How files are sent | Setup needed |
|---|---|---|
| DMs | FileConsentCard → user accepts → bot uploads | Works out of the box |
| Group chats/channels | Upload to SharePoint → share link | Requires sharePointSiteId + Graph permissions |
| Images (any context) | Base64-encoded inline | Works out of the box |
Bots don't have a personal OneDrive drive (the /me/drive Graph API endpoint doesn't work for application identities). To send files in group chats/channels, the bot uploads to a SharePoint site and creates a sharing link.
Sites.ReadWrite.All (Application) - upload files to SharePointChat.Read.All (Application) - optional, enables per-user sharing links # Via Graph Explorer or curl with a valid token:
curl -H "Authorization: Bearer $TOKEN" \
"https://graph.microsoft.com/v1.0/sites/{hostname}:/{site-path}"
# Example: for a site at "contoso.sharepoint.com/sites/BotFiles"
curl -H "Authorization: Bearer $TOKEN" \
"https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/BotFiles"
# Response includes: "id": "contoso.sharepoint.com,guid1,guid2" {
channels: {
msteams: {
// ... other config ...
sharePointSiteId: "contoso.sharepoint.com,guid1,guid2",
},
},
}| Permission | Sharing behavior |
|---|---|
Sites.ReadWrite.All only | Organization-wide sharing link (anyone in org can access) |
Sites.ReadWrite.All + Chat.Read.All | Per-user sharing link (only chat members can access) |
Per-user sharing is more secure as only the chat participants can access the file. If Chat.Read.All permission is missing, the bot falls back to organization-wide sharing.
| Scenario | Result |
|---|---|
Group chat + file + sharePointSiteId configured | Upload to SharePoint, send sharing link |
Group chat + file + no sharePointSiteId | Attempt OneDrive upload (may fail), send text only |
| Personal chat + file | FileConsentCard flow (works without SharePoint) |
| Any context + image | Base64-encoded inline (works without SharePoint) |
Uploaded files are stored in a /OpenClawShared/ folder in the configured SharePoint site's default document library.
OpenClaw sends Teams polls as Adaptive Cards (there is no native Teams poll API).
openclaw message poll --channel msteams --target conversation:<id> ...~/.openclaw/msteams-polls.json.Send any Adaptive Card JSON to Teams users or conversations using the message tool or CLI.
The card parameter accepts an Adaptive Card JSON object. When card is provided, the message text is optional.
Agent tool:
{
action: "send",
channel: "msteams",
target: "user:<id>",
card: {
type: "AdaptiveCard",
version: "1.5",
body: [{ type: "TextBlock", text: "Hello!" }],
},
}CLI:
openclaw message send --channel msteams \
--target "conversation:19:abc...@thread.tacv2" \
--card '{"type":"AdaptiveCard","version":"1.5","body":[{"type":"TextBlock","text":"Hello!"}]}'See Adaptive Cards documentation for card schema and examples. For target format details.
MSTeams targets use prefixes to distinguish between users and conversations:
| Target type | Format | Example |
|---|---|---|
| User (by ID) | user:<aad-object-id> | user:40a1a0ed-4ff2-4164-a219-55518990c197 |
| User (by name) | user:<display-name> | user:John Smith (requires Graph API) |
| Group/channel | conversation:<conversation-id> | conversation:19:abc123...@thread.tacv2 |
| Group/channel (raw) | <conversation-id> | 19:abc123...@thread.tacv2 (if contains @thread) |
CLI examples:
# Send to a user by ID
openclaw message send --channel msteams --target "user:40a1a0ed-..." --message "Hello"
# Send to a user by display name (triggers Graph API lookup)
openclaw message send --channel msteams --target "user:John Smith" --message "Hello"
# Send to a group chat or channel
openclaw message send --channel msteams --target "conversation:19:abc...@thread.tacv2" --message "Hello"
# Send an Adaptive Card to a conversation
openclaw message send --channel msteams --target "conversation:19:abc...@thread.tacv2" \
--card '{"type":"AdaptiveCard","version":"1.5","body":[{"type":"TextBlock","text":"Hello"}]}'Agent tool examples:
{
action: "send",
channel: "msteams",
target: "user:John Smith",
message: "Hello!",
}{
action: "send",
channel: "msteams",
target: "conversation:19:abc...@thread.tacv2",
card: {
type: "AdaptiveCard",
version: "1.5",
body: [{ type: "TextBlock", text: "Hello" }],
},
}Note: Without the user: prefix, names default to group/team resolution. Always use user: when targeting people by display name.
/gateway/configuration for dmPolicy and allowlist gating.The groupId query parameter in Teams URLs is NOT the team ID used for configuration. Extract IDs from the URL path instead:
Team URL:
https://teams.microsoft.com/l/team/19%3ABk4j...%40thread.tacv2/conversations?groupId=...Channel URL:
https://teams.microsoft.com/l/channel/19%3A15bc...%40thread.tacv2/ChannelName?groupId=...For config:
/team/ (URL-decoded, e.g., 19:Bk4j...@thread.tacv2)/channel/ (URL-decoded)groupId query parameterBots have limited support in private channels:
| Feature | Standard Channels | Private Channels |
|---|---|---|
| Bot installation | Yes | Limited |
| Real-time messages (webhook) | Yes | May not work |
| RSC permissions | Yes | May behave differently |
| @mentions | Yes | If bot is accessible |
| Graph API history | Yes | Yes (with permissions) |
Workarounds if private channels don't work:
ChannelMessage.Read.All)channels.msteams.requireMention=false or configure per team/channel.outline.png, 192x192 for color.png).webApplicationInfo.id matches your bot's App ID exactlyChannelMessage.Read.Group for teams, ChatMessage.Read.Chat for group chatsAbout the author

Sarah Jenkins is a seasoned OpenClaw developer with a strong focus on optimizing high-performance computing solutions. Her work primarily involves crafting efficient parallel algorithms and enhancing GPU acceleration for complex scientific simulations. Jenkins is renowned for her meticulous attention to detail and her ability to translate intricate theoretical concepts into practical, robust OpenClaw implementations.

by Sarah Jenkins
by Sarah Jenkins