Skip to main content

Microsoft Teams Integration

The Microsoft Teams integration lets agents send messages, reply in threads, manage channels, and list teams — directly from a conversation. Use it for alert routing, escalation flows, or any workflow where the agent needs to reach a team via Teams.

Authentication

Microsoft Teams uses an OAuth2 access token from the Microsoft Graph API.

Required Graph API permissions (Application or Delegated):

  • ChannelMessage.Send — send messages to channels
  • Chat.ReadWrite — send and read chat messages
  • Channel.Create — create channels
  • Team.ReadBasic.All — list teams
  • ChannelSettings.ReadWrite.All — read channel settings

To get a token:

  1. Register an app in Azure PortalAzure Active DirectoryApp registrations
  2. Add the required Microsoft Graph API permissions
  3. Generate a client credentials token or use a delegated token from a user sign-in flow
  4. Copy the access token
FieldDescription
Access TokenBearer token for the Microsoft Graph API (https://graph.microsoft.com)

Installing

  1. Go to your project → IntegrationsBrowse
  2. Find Microsoft Teams and click Install
  3. Paste your Access Token
  4. Select the actions you want to enable
  5. Click Install

Actions

send_channel_message — Send Channel Message

Posts a message to a Teams channel.

Tool reference: {{tool:microsoft_teams_send_channel_message}}

ParameterRequiredDescription
team_idYesTeams group/team ID
channel_idYesChannel ID within the team
contentYesMessage text
content_typeNotext (default) or html for rich formatting

Returns: message_id, created_at


reply_to_message — Reply to Message

Replies to an existing message in a channel thread.

Tool reference: {{tool:microsoft_teams_reply_to_message}}

ParameterRequiredDescription
team_idYesTeam ID
channel_idYesChannel ID
message_idYesID of the message to reply to
contentYesReply text
content_typeNotext or html

send_chat_message — Send Chat Message

Sends a message to a 1:1 or group chat.

Tool reference: {{tool:microsoft_teams_send_chat_message}}

ParameterRequiredDescription
chat_idYesChat ID (retrieve from Microsoft Graph)
contentYesMessage content

create_channel — Create Channel

Creates a new channel in a team.

Tool reference: {{tool:microsoft_teams_create_channel}}

ParameterRequiredDescription
team_idYesTeam to create the channel in
channel_nameYesChannel display name
descriptionNoChannel description
membership_typeNostandard (default) or private

Returns: channel_id, channel_name


list_teams — List Teams

Returns all teams the integration account has access to.

Tool reference: {{tool:microsoft_teams_list_teams}}

No parameters required.

Returns: Array of team_id, name, description


list_channels — List Channels

Returns all channels in a team.

Tool reference: {{tool:microsoft_teams_list_channels}}

ParameterRequiredDescription
team_idYesTeam ID

Returns: Array of channel_id, name, membership_type


update_message — Update Message

Edits a previously sent channel message.

Tool reference: {{tool:microsoft_teams_update_message}}

ParameterRequiredDescription
team_idYesTeam ID
channel_idYesChannel ID
message_idYesMessage to update
contentYesNew message content

Using Teams in an agent

Escalation to Teams

When a customer issue cannot be resolved automatically, or the user requests a human agent:
1. Collect a summary of the issue.
2. Use {{tool:microsoft_teams_send_channel_message}} to post to the support escalations channel:
- team_id: <your team ID>
- channel_id: <support channel ID>
- content: "🔔 Escalation needed\n**User:** [name]\n**Issue:** [summary]\n**Conversation started:** [time]"
3. Tell the user: "I've notified the support team and someone will follow up shortly."

Finding your team and channel IDs

Use {{tool:microsoft_teams_list_teams}} to find your team IDs, then {{tool:microsoft_teams_list_channels}} with a team ID to find channel IDs. Copy these into your agent's system prompt as constants.

Troubleshooting

401 Unauthorized

The access token has expired. Microsoft Graph tokens expire after 1 hour. Regenerate and reinstall.

403 Forbidden

The app registration is missing the required Graph API permissions, or admin consent hasn't been granted. Go to Azure Portal → App registrations → API permissions → Grant admin consent.

404 Team or channel not found

The team_id or channel_id is incorrect. Use list_teams and list_channels to find the correct IDs.

Messages not appearing in channel

The app may not be a member of the team. For application permissions, the app needs to be granted access to the team by a Teams admin.