Skip to main content

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

OptionValueRequiredEnvDefaultDescription
--teamTEAM_IDnoTeam ID for channel messages
--channelCHANNEL_IDnoChannel ID for channel messages
--chatCHAT_IDnoChat ID for chat messages
--bodyTEXTnoMessage body text
--stdinnoRead message body from stdin
--content-typeCONTENT_TYPEnotextContent type: text or html
--adaptive-cardPATHnoPath to adaptive card JSON file
--imageIMAGEnoImage file to send inline, like a pasted screenshot (repeatable)
--attachATTACHnoFile 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

CodeMeaning
0success
2invalid input
3authentication error
4permission denied
5not found
6rate limited

See Also