New260+ blocks and 240+ tools are now fully documented
DocumentationReferenceCore BlocksMicrosoft 365
Block

Microsoft Teams Block

Read, write, and create messages

The Microsoft Teams block integrates Microsoft Teams messaging into your workflows using OAuth authentication. It can read messages from chats and channels and post new messages to them. Reach for it when a workflow needs to pull conversation content, notify a team, or react to incoming Teams events via a webhook trigger.

Overview

PropertyValue
Typemicrosoft_teams
Categorytools
Color#E0E0E0

When to Use

  • Read recent messages from a one-on-one or group chat
  • Post a chat message to notify a person or group
  • Read messages from a specific channel within a team
  • Send a channel message to broadcast updates to a team
  • Pull message metadata and attachment information for downstream processing
  • Start workflows from incoming Teams messages via the microsoftteams_webhook trigger

Configuration

Operation

Dropdown (operation) selecting what the block does. Defaults to read_chat.

LabelID
Read Chat Messagesread_chat
Write Chat Messagewrite_chat
Read Channel Messagesread_channel
Write Channel Messagewrite_channel

Microsoft Account

Required OAuth credential (credential) connecting your Microsoft account to Teams. The connection requests the following scopes: openid, profile, email, User.Read, Chat.Read, Chat.ReadWrite, Chat.ReadBasic, Channel.ReadBasic.All, ChannelMessage.Send, ChannelMessage.Read.All, Group.Read.All, Group.ReadWrite.All, Team.ReadBasic.All, offline_access.

Select Chat (chatId)

Visible for read_chat and write_chat operations — basic mode.

File-selector that lets you pick a chat from your Microsoft account. Resolves to the chat ID used by the underlying tool.

Chat ID (manualChatId)

Visible for read_chat and write_chat operations — advanced mode.

Short text input for entering the chat ID directly when you prefer not to use the selector.

Select Team (teamId)

Visible for read_channel and write_channel operations — basic mode.

File-selector that lets you pick a team from your Microsoft account.

Team ID (manualTeamId)

Visible for read_channel and write_channel operations — advanced mode.

Short text input for entering the team ID directly.

Select Channel (channelId)

Visible for read_channel and write_channel operations — basic mode.

File-selector that lets you pick a channel within the selected team.

Channel ID (manualChannelId)

Visible for read_channel and write_channel operations — advanced mode.

Short text input for entering the channel ID directly.

Message (content)

Required for write_chat and write_channel operations.

Long-text input for the message body to send to the chat or channel.

Trigger Configuration (triggerConfig)

Configures the microsoftteams_webhook trigger so the block can start workflows from incoming Microsoft Teams events.

Inputs & Outputs

Inputs

  • operation (string) — Operation to perform (read_chat, write_chat, read_channel, or write_channel)
  • credential (string) — Microsoft Teams OAuth access token
  • messageId (string) — Message identifier
  • chatId (string) — Chat identifier (from the selector)
  • manualChatId (string) — Manual chat identifier (advanced mode)
  • channelId (string) — Channel identifier (from the selector)
  • manualChannelId (string) — Manual channel identifier (advanced mode)
  • teamId (string) — Team identifier (from the selector)
  • manualTeamId (string) — Manual team identifier (advanced mode)
  • content (string) — Message content to send (write operations)

Outputs

Read operation outputs:

  • content (string) — Formatted message content from the chat or channel
  • metadata (json) — Message metadata with full details
  • messageCount (number) — Number of messages retrieved
  • messages (json) — Array of message objects
  • totalAttachments (number) — Total number of attachments across all messages
  • attachmentTypes (json) — Array of unique attachment content types found

Write operation outputs:

  • updatedContent (boolean) — Whether content was successfully sent
  • messageId (string) — ID of the created/sent message
  • createdTime (string) — Timestamp when the message was created
  • url (string) — Web URL to the message

Individual message field outputs (from read operations):

  • sender (string) — Message sender display name
  • messageTimestamp (string) — Individual message timestamp
  • messageType (string) — Type of message (e.g. message, systemEventMessage)

Trigger (webhook) outputs:

  • type (string) — Type of Teams message event
  • id (string) — Unique message identifier
  • timestamp (string) — Message timestamp
  • localTimestamp (string) — Local timestamp of the message
  • serviceUrl (string) — Microsoft Teams service URL
  • channelId (string) — Teams channel ID where the event occurred
  • from_id (string) — User ID who sent the message
  • from_name (string) — Username who sent the message
  • conversation_id (string) — Conversation/thread ID
  • text (string) — Message text content

Tools

  • Read Microsoft Teams Chat (microsoft_teams_read_chat) — Fetches the 50 most recent messages from a Teams chat via GET /chats/{chatId}/messages. Returns formatted text, message objects, sender names, timestamps, and attachment statistics.
  • Write to Microsoft Teams Chat (microsoft_teams_write_chat) — Posts a new text message to a Teams chat via POST /chats/{chatId}/messages. Returns the new message ID, creation time, and web URL.
  • Read Microsoft Teams Channel (microsoft_teams_read_channel) — Fetches messages from a Teams channel via GET /teams/{teamId}/channels/{channelId}/messages. Returns formatted text, message objects, sender names, timestamps, and attachment statistics.
  • Write to Microsoft Teams Channel (microsoft_teams_write_channel) — Posts a new text message to a Teams channel via POST /teams/{teamId}/channels/{channelId}/messages. Returns the new message ID, creation time, and web URL.

YAML Example

microsoft_teams_1:
  type: microsoft_teams
  name: "Microsoft Teams"
  inputs:
    operation: "write_channel"
    credential: "{{credentials.microsoft-teams}}"
    teamId: "your-team-id"
    channelId: "your-channel-id"
    content: "{{start.input}}"
  connections:
    outgoing:
      - target: next-block-id