teams message send
Auto-generated reference
This page is generated from checked-in CLI metadata for release v0.3.0. Do not edit it by hand.
Send a message to a channel or chat.
Synopsis
teams message send (--team TEAM_ID --channel CHANNEL_ID | --chat CHAT_ID) [--body TEXT | --stdin] [--content-type text|html] [--adaptive-card PATH] [--image PATH]... [--attach PATH]...
Options
| Option | Value | Required | Env | Default | Description |
|---|---|---|---|---|---|
--team | TEAM_ID | no | Team ID for channel messages | ||
--channel | CHANNEL_ID | no | Channel ID for channel messages | ||
--chat | CHAT_ID | no | Chat ID for chat messages | ||
--body | TEXT | no | Message body text | ||
--stdin | no | Read message body from stdin | |||
--content-type | CONTENT_TYPE | no | text | Content type: text or html | |
--adaptive-card | PATH | no | Path to adaptive card JSON file | ||
--image | IMAGE | no | Image file to send inline, like a pasted screenshot (repeatable) | ||
--attach | ATTACH | no | File to upload and attach (repeatable; needs a Files.ReadWrite scope) |
Examples
Send text to a channel
teams message send --team "$TEAM_ID" --channel "$CHANNEL_ID" --body "Deploy complete"
Send an inline image
teams message send --chat "$CHAT_ID" --image ./screenshot.png --output json
Attach a file
teams message send --chat "$CHAT_ID" --body "Logs attached" --attach ./logs.zip --output json
Exit Codes
| Code | Meaning |
|---|---|
| 0 | success |
| 2 | invalid input |
| 3 | authentication error |
| 4 | permission denied |
| 5 | not found |
| 6 | rate limited |