teams message send
Auto-generated reference
This page is generated from checked-in CLI metadata for release v0.9.0. Do not edit it by hand.
Send a message to a channel or chat
Synopsis
teams message send [OPTIONS]
Options
| Option | Value | Required | Env | Default | Description |
|---|---|---|---|---|---|
--team | TEAM | no | Team ID (for channel messages) | ||
--channel | CHANNEL | no | Channel ID (for channel messages) | ||
--chat | CHAT | no | Chat ID (for chat messages) | ||
--body | BODY | no | Message body text | ||
--stdin | STDIN | no | false | Read message body from stdin | |
--content-type | CONTENT_TYPE | no | text | Content type: text or html | |
--adaptive-card | ADAPTIVE_CARD | 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) | ||
--mention | USER | no | User to @mention (repeatable): an Entra object ID or UPN | ||
--subject | SUBJECT | no | Subject line for a channel root message | ||
--quote | MESSAGE_ID | no | Quote-reply to this chat message, as the Teams client's Reply does (repeatable; Graph accepts up to 5) |
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 |