Skip to main content

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​

OptionValueRequiredEnvDefaultDescription
--teamTEAMnoTeam ID (for channel messages)
--channelCHANNELnoChannel ID (for channel messages)
--chatCHATnoChat ID (for chat messages)
--bodyBODYnoMessage body text
--stdinSTDINnofalseRead message body from stdin
--content-typeCONTENT_TYPEnotextContent type: text or html
--adaptive-cardADAPTIVE_CARDnoPath 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)
--mentionUSERnoUser to @mention (repeatable): an Entra object ID or UPN
--subjectSUBJECTnoSubject line for a channel root message
--quoteMESSAGE_IDnoQuote-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​

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

See Also​