Skip to main content

Send a Channel Message

Prerequisites

  • Delegated login.
  • Team and channel IDs.
  • ChannelMessage.Send consent.
teams message send --team "$TEAM_ID" --channel "$CHANNEL_ID" --body "Hello from teams-cli" --output json

Send an inline image:

teams message send --team "$TEAM_ID" --channel "$CHANNEL_ID" --image ./screenshot.png --output json

Attach a file. Channel attachments upload to the team's SharePoint-backed file store and require Files.ReadWrite.All.

teams message send \
--team "$TEAM_ID" \
--channel "$CHANNEL_ID" \
--body "Logs attached" \
--attach ./logs.zip \
--output json

Verify with:

teams message list --team "$TEAM_ID" --channel "$CHANNEL_ID" --page-size 1 --output json

Inline images are capped at 3 MB each. File attachments use Microsoft Graph's 250 MB simple-upload limit.