You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/channels/msteams.md
+149-3Lines changed: 149 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ read_when:
8
8
> "Abandon all hope, ye who enter here."
9
9
10
10
11
-
Updated: 2026-01-16
11
+
Updated: 2026-01-21
12
12
13
-
Status: text + DM attachments are supported; channel/group attachments require Microsoft Graph permissions. Polls are sent via Adaptive Cards.
13
+
Status: text + DM attachments are supported; channel/group file sending requires `sharePointSiteId` + Graph permissions (see [Sending files in group chats](#sending-files-in-group-chats)). Polls are sent via Adaptive Cards.
14
14
15
15
## Plugin required
16
16
Microsoft Teams ships as a plugin and is not bundled with the core install.
@@ -403,7 +403,7 @@ Clawdbot handles this by returning quickly and sending replies proactively, but
403
403
Teams markdown is more limited than Slack or Discord:
-`channels.msteams.sharePointSiteId`: SharePoint site ID for file uploads in group chats/channels (see [Sending files in group chats](#sending-files-in-group-chats)).
425
426
426
427
## Routing & Sessions
427
428
- Session keys follow the standard agent format (see [/concepts/session](/concepts/session)):
@@ -471,6 +472,75 @@ Teams recently introduced two channel UI styles over the same underlying data mo
471
472
Without Graph permissions, channel messages with images will be received as text-only (the image content is not accessible to the bot).
472
473
By default, Clawdbot only downloads media from Microsoft/Teams hostnames. Override with `channels.msteams.mediaAllowHosts` (use `["*"]` to allow any host).
473
474
475
+
## Sending files in group chats
476
+
477
+
Bots can send files in DMs using the FileConsentCard flow (built-in). However, **sending files in group chats/channels** requires additional setup:
478
+
479
+
| Context | How files are sent | Setup needed |
480
+
|---------|-------------------|--------------|
481
+
|**DMs**| FileConsentCard → user accepts → bot uploads | Works out of the box |
482
+
|**Group chats/channels**| Upload to SharePoint → share link | Requires `sharePointSiteId` + Graph permissions |
483
+
|**Images (any context)**| Base64-encoded inline | Works out of the box |
484
+
485
+
### Why group chats need SharePoint
486
+
487
+
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.
488
+
489
+
### Setup
490
+
491
+
1.**Add Graph API permissions** in Entra ID (Azure AD) → App Registration:
492
+
-`Sites.ReadWrite.All` (Application) - upload files to SharePoint
|`Sites.ReadWrite.All` only | Organization-wide sharing link (anyone in org can access) |
527
+
|`Sites.ReadWrite.All` + `Chat.Read.All`| Per-user sharing link (only chat members can access) |
528
+
529
+
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.
530
+
531
+
### Fallback behavior
532
+
533
+
| Scenario | Result |
534
+
|----------|--------|
535
+
| Group chat + file + `sharePointSiteId` configured | Upload to SharePoint, send sharing link |
536
+
| Group chat + file + no `sharePointSiteId`| Attempt OneDrive upload (may fail), send text only |
537
+
| Personal chat + file | FileConsentCard flow (works without SharePoint) |
538
+
| Any context + image | Base64-encoded inline (works without SharePoint) |
539
+
540
+
### Files stored location
541
+
542
+
Uploaded files are stored in a `/ClawdbotShared/` folder in the configured SharePoint site's default document library.
543
+
474
544
## Polls (Adaptive Cards)
475
545
Clawdbot sends Teams polls as Adaptive Cards (there is no native Teams poll API).
476
546
@@ -479,6 +549,82 @@ Clawdbot sends Teams polls as Adaptive Cards (there is no native Teams poll API)
479
549
- The gateway must stay online to record votes.
480
550
- Polls do not auto-post result summaries yet (inspect the store file if needed).
481
551
552
+
## Adaptive Cards (arbitrary)
553
+
Send any Adaptive Card JSON to Teams users or conversations using the `message` tool or CLI.
554
+
555
+
The `card` parameter accepts an Adaptive Card JSON object. When `card` is provided, the message text is optional.
See [Adaptive Cards documentation](https://adaptivecards.io/) for card schema and examples. For target format details, see [Target formats](#target-formats) below.
579
+
580
+
## Target formats
581
+
582
+
MSTeams targets use prefixes to distinguish between users and conversations:
583
+
584
+
| Target type | Format | Example |
585
+
|-------------|--------|---------|
586
+
| User (by ID) |`user:<aad-object-id>`|`user:40a1a0ed-4ff2-4164-a219-55518990c197`|
587
+
| User (by name) |`user:<display-name>`|`user:John Smith` (requires Graph API) |
0 commit comments