Skip to main content

teams message attachments download

Auto-generated reference

This page is generated from checked-in CLI metadata for release v0.9.0. Do not edit it by hand.

Download attachments and inline images from a message

Synopsis​

teams message attachments download [OPTIONS] [MESSAGE_ID]

Options​

OptionValueRequiredEnvDefaultDescription
--teamTEAMnoTeam ID (for channel messages)
--channelCHANNELnoChannel ID (for channel messages)
--chatCHATnoChat ID (for chat messages)
--replyREPLYnoReply ID (for a reply within a channel thread)
MESSAGE_IDMESSAGE_IDnoMessage ID
--messageMESSAGEnoMessage ID
--indexINDEXnoDownload only the item with this index (from attachments list)
--dirDIRnoOutput directory for downloaded files
--pathPATHnoExact output file path for a single item; use '-' for stdout

Examples​

Download all media from a chat message​

teams message attachments download --chat "$CHAT_ID" "$MESSAGE_ID" --dir ./assets --output json

Stream one item as raw bytes (no JSON envelope)​

teams message attachments download --chat "$CHAT_ID" "$MESSAGE_ID" --index 0 --path - > image.png

Exit Codes​

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

See Also​